xylia.sax.contentmodelparser
Class ContentModelParserDeclHandler

java.lang.Object
  |
  +--xylia.sax.contentmodelparser.ContentModelParserDeclHandler
All Implemented Interfaces:
org.xml.sax.ext.DeclHandler

public class ContentModelParserDeclHandler
extends java.lang.Object
implements org.xml.sax.ext.DeclHandler

A DeclHandler to handle content models.

This is a filter in that events are passed to the next DeclHandler if any.

The elementDecl events cause the content model to be parsed and its parsed representation is passed onto a single listener object of type ParsedContentModelHandler. The representation of the content model is build by an object of type ContentModelFactory.

Typical usage of this class is as follows

     XMLReader xmlr ; 
     ...
     ContentModelMap hmap = new ContentModelMap() ;
     DeclHandler dh = new ContentModelParserDeclHandler( hmap ) ;
     xmlr.setProperty("http://xml.org/sax/properties/declaration-handler", dh);
 

Now, after parsing, hmap will be a Map from element names to DefaultContentModel.

Copyright: Copyright (c) 2001 Company: MUN

Version:
1.0
Author:
Theodore Norvell

Constructor Summary
ContentModelParserDeclHandler(ParsedContentModelHandler parsedContentModelHandler)
          Construct with a DefaultContentModelFactory.
ContentModelParserDeclHandler(ParsedContentModelHandler parsedContentModelHandler, ContentModelFactory factory)
          Constuctor.
 
Method Summary
 void attributeDecl(java.lang.String parm1, java.lang.String parm2, java.lang.String parm3, java.lang.String parm4, java.lang.String parm5)
          The event is simply passed to the next DeclHandler.
 void elementDecl(java.lang.String qname, java.lang.String contentModel)
          Parses the content model and passes the parsed representation to the ParsedContentModelHandler.
 void externalEntityDecl(java.lang.String parm1, java.lang.String parm2, java.lang.String parm3)
          The event is simply passed to the next DeclHandler.
 void internalEntityDecl(java.lang.String parm1, java.lang.String parm2)
          The event is simply passed to the next DeclHandler.
 void setNextHandler(org.xml.sax.ext.DeclHandler nextHandler)
          Set the next handler in the chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentModelParserDeclHandler

public ContentModelParserDeclHandler(ParsedContentModelHandler parsedContentModelHandler)
Construct with a DefaultContentModelFactory. This means that the parsed content models will be of type DefaultContentModel
Parameters:
parsedContentModelHandler - the receiver of parsed content models.
See Also:
DefaultContentModel

ContentModelParserDeclHandler

public ContentModelParserDeclHandler(ParsedContentModelHandler parsedContentModelHandler,
                                     ContentModelFactory factory)
Constuctor.
Parameters:
parsedContentModelHandler - The receiver of parsed content models
factory - An object that constructs the parsed content models.
Method Detail

setNextHandler

public void setNextHandler(org.xml.sax.ext.DeclHandler nextHandler)
Set the next handler in the chain.

elementDecl

public void elementDecl(java.lang.String qname,
                        java.lang.String contentModel)
                 throws org.xml.sax.SAXException
Parses the content model and passes the parsed representation to the ParsedContentModelHandler. The event is then passed to the next DeclHandler.
Specified by:
elementDecl in interface org.xml.sax.ext.DeclHandler
Parameters:
qname - The qualified name of the object.
contentModel - The content model as a string.

attributeDecl

public void attributeDecl(java.lang.String parm1,
                          java.lang.String parm2,
                          java.lang.String parm3,
                          java.lang.String parm4,
                          java.lang.String parm5)
                   throws org.xml.sax.SAXException
The event is simply passed to the next DeclHandler.
Specified by:
attributeDecl in interface org.xml.sax.ext.DeclHandler

internalEntityDecl

public void internalEntityDecl(java.lang.String parm1,
                               java.lang.String parm2)
                        throws org.xml.sax.SAXException
The event is simply passed to the next DeclHandler.
Specified by:
internalEntityDecl in interface org.xml.sax.ext.DeclHandler

externalEntityDecl

public void externalEntityDecl(java.lang.String parm1,
                               java.lang.String parm2,
                               java.lang.String parm3)
                        throws org.xml.sax.SAXException
The event is simply passed to the next DeclHandler.
Specified by:
externalEntityDecl in interface org.xml.sax.ext.DeclHandler