286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001, 2002,2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.parsers;
286N/A
286N/Aimport com.sun.org.apache.xerces.internal.xni.Augmentations;
286N/Aimport com.sun.org.apache.xerces.internal.xni.NamespaceContext;
286N/Aimport com.sun.org.apache.xerces.internal.xni.QName;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLAttributes;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLLocator;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLString;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XNIException;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
286N/A
286N/A/**
286N/A * This is the base class for all XML document parsers. XMLDocumentParser
286N/A * provides a common implementation shared by the various document parsers
286N/A * in the Xerces package. While this class is provided for convenience, it
286N/A * does not prevent other kinds of parsers to be constructed using the XNI
286N/A * interfaces.
286N/A *
286N/A * @author Arnaud Le Hors, IBM
286N/A * @author Andy Clark, IBM
286N/A *
286N/A */
286N/Apublic abstract class AbstractXMLDocumentParser
286N/A extends XMLParser
286N/A implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A // state
286N/A
286N/A /** True if inside DTD. */
286N/A protected boolean fInDTD;
286N/A
286N/A /** Document source*/
286N/A protected XMLDocumentSource fDocumentSource;
286N/A
286N/A /** DTD source*/
286N/A protected XMLDTDSource fDTDSource;
286N/A
286N/A /** DTD content model source*/
286N/A protected XMLDTDContentModelSource fDTDContentModelSource;
286N/A
286N/A //
286N/A // Constructors
286N/A //
286N/A
286N/A /**
286N/A * Constructs a document parser using the default symbol table
286N/A * and grammar pool.
286N/A */
286N/A protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
286N/A super(config);
286N/A
286N/A // set handlers
286N/A config.setDocumentHandler(this);
286N/A config.setDTDHandler(this);
286N/A config.setDTDContentModelHandler(this);
286N/A
286N/A } // <init>(XMLParserConfiguration)
286N/A
286N/A //
286N/A // XMLDocumentHandler methods
286N/A //
286N/A
286N/A /**
286N/A * The start of the document.
286N/A *
286N/A * @param locator The system identifier of the entity if the entity
286N/A * is external, null otherwise.
286N/A * @param encoding The auto-detected IANA encoding name of the entity
286N/A * stream. This value will be null in those situations
286N/A * where the entity encoding is not auto-detected (e.g.
286N/A * internal entities or a document entity that is
286N/A * parsed from a java.io.Reader).
286N/A * @param namespaceContext
286N/A * The namespace context in effect at the
286N/A * start of this document.
286N/A * This object represents the current context.
286N/A * Implementors of this class are responsible
286N/A * for copying the namespace bindings from the
286N/A * the current context (and its parent contexts)
286N/A * if that information is important.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A
286N/A public void startDocument(XMLLocator locator, String encoding,
286N/A NamespaceContext namespaceContext, Augmentations augs)
286N/A throws XNIException {
286N/A } // startDocument(XMLLocator,String)
286N/A
286N/A /**
286N/A * Notifies of the presence of an XMLDecl line in the document. If
286N/A * present, this method will be called immediately following the
286N/A * startDocument call.
286N/A *
286N/A * @param version The XML version.
286N/A * @param encoding The IANA encoding name of the document, or null if
286N/A * not specified.
286N/A * @param standalone The standalone value, or null if not specified.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
286N/A throws XNIException {
286N/A } // xmlDecl(String,String,String)
286N/A
286N/A /**
286N/A * Notifies of the presence of the DOCTYPE line in the document.
286N/A *
286N/A * @param rootElement The name of the root element.
286N/A * @param publicId The public identifier if an external DTD or null
286N/A * if the external DTD is specified using SYSTEM.
286N/A * @param systemId The system identifier if an external DTD, null
286N/A * @param augs Additional information that may include infoset augmentations
286N/A * otherwise.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
286N/A throws XNIException {
286N/A } // doctypeDecl(String,String,String)
286N/A
286N/A /**
286N/A * The start of an element. If the document specifies the start element
286N/A * by using an empty tag, then the startElement method will immediately
286N/A * be followed by the endElement method, with no intervening methods.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param attributes The element attributes.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
286N/A throws XNIException {
286N/A } // startElement(QName,XMLAttributes)
286N/A
286N/A /**
286N/A * An empty element.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param attributes The element attributes.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
286N/A throws XNIException {
286N/A
286N/A startElement(element, attributes, augs);
286N/A endElement(element, augs);
286N/A
286N/A } // emptyElement(QName,XMLAttributes)
286N/A
286N/A /**
286N/A * Character content.
286N/A *
286N/A * @param text The content.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void characters(XMLString text, Augmentations augs) throws XNIException {
286N/A } // characters(XMLString)
286N/A
286N/A /**
286N/A * Ignorable whitespace. For this method to be called, the document
286N/A * source must have some way of determining that the text containing
286N/A * only whitespace characters should be considered ignorable. For
286N/A * example, the validator can determine if a length of whitespace
286N/A * characters in the document are ignorable based on the element
286N/A * content model.
286N/A *
286N/A * @param text The ignorable whitespace.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
286N/A } // ignorableWhitespace(XMLString)
286N/A
286N/A /**
286N/A * The end of an element.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endElement(QName element, Augmentations augs) throws XNIException {
286N/A } // endElement(QName)
286N/A
286N/A /**
286N/A * The start of a CDATA section.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startCDATA(Augmentations augs) throws XNIException {
286N/A } // startCDATA()
286N/A
286N/A /**
286N/A * The end of a CDATA section.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endCDATA(Augmentations augs) throws XNIException {
286N/A } // endCDATA()
286N/A
286N/A /**
286N/A * The end of the document.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endDocument(Augmentations augs) throws XNIException {
286N/A } // endDocument()
286N/A
286N/A
286N/A /**
286N/A * This method notifies the start of an entity.
286N/A * <p>
286N/A * <strong>Note:</strong> This method is not called for entity references
286N/A * appearing as part of attribute values.
286N/A *
286N/A * @param name The name of the entity.
286N/A * @param identifier The resource identifier.
286N/A * @param encoding The auto-detected IANA encoding name of the entity
286N/A * stream. This value will be null in those situations
286N/A * where the entity encoding is not auto-detected (e.g.
286N/A * internal entities or a document entity that is
286N/A * parsed from a java.io.Reader).
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startGeneralEntity(String name,
286N/A XMLResourceIdentifier identifier,
286N/A String encoding,
286N/A Augmentations augs) throws XNIException {
286N/A } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
286N/A
286N/A /**
286N/A * Notifies of the presence of a TextDecl line in an entity. If present,
286N/A * this method will be called immediately following the startEntity call.
286N/A * <p>
286N/A * <strong>Note:</strong> This method will never be called for the
286N/A * document entity; it is only called for external general entities
286N/A * referenced in document content.
286N/A * <p>
286N/A * <strong>Note:</strong> This method is not called for entity references
286N/A * appearing as part of attribute values.
286N/A *
286N/A * @param version The XML version, or null if not specified.
286N/A * @param encoding The IANA encoding name of the entity.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
286N/A } // textDecl(String, String, Augmentations)
286N/A
286N/A /**
286N/A * This method notifies the end of an entity.
286N/A * <p>
286N/A * <strong>Note:</strong> This method is not called for entity references
286N/A * appearing as part of attribute values.
286N/A *
286N/A * @param name The name of the entity.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void endGeneralEntity(String name, Augmentations augs)
286N/A throws XNIException {
286N/A } // endGeneralEntity(String,Augmentations)
286N/A
286N/A /**
286N/A * A comment.
286N/A *
286N/A * @param text The text in the comment.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by application to signal an error.
286N/A */
286N/A public void comment(XMLString text, Augmentations augs) throws XNIException {
286N/A } // comment (XMLString, Augmentations)
286N/A
286N/A /**
286N/A * A processing instruction. Processing instructions consist of a
286N/A * target name and, optionally, text data. The data is only meaningful
286N/A * to the application.
286N/A * <p>
286N/A * Typically, a processing instruction's data will contain a series
286N/A * of pseudo-attributes. These pseudo-attributes follow the form of
286N/A * element attributes but are <strong>not</strong> parsed or presented
286N/A * to the application as anything other than text. The application is
286N/A * responsible for parsing the data.
286N/A *
286N/A * @param target The target.
286N/A * @param data The data or null if none specified.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void processingInstruction(String target, XMLString data, Augmentations augs)
286N/A throws XNIException {
286N/A } // processingInstruction(String, XMLString, Augmentations)
286N/A
286N/A
286N/A /** Sets the document source */
286N/A public void setDocumentSource(XMLDocumentSource source){
286N/A fDocumentSource = source;
286N/A } // setDocumentSource
286N/A
286N/A /** Returns the document source */
286N/A public XMLDocumentSource getDocumentSource (){
286N/A return fDocumentSource;
286N/A } // getDocumentSource
286N/A //
286N/A // XMLDTDHandler methods
286N/A //
286N/A
286N/A /**
286N/A * The start of the DTD.
286N/A *
286N/A * @param locator The document locator, or null if the document
286N/A * location cannot be reported during the parsing of
286N/A * the document DTD. However, it is <em>strongly</em>
286N/A * recommended that a locator be supplied that can
286N/A * at least report the base system identifier of the
286N/A * DTD.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
286N/A fInDTD = true;
286N/A } // startDTD(XMLLocator)
286N/A
286N/A
286N/A /**
286N/A * The start of the DTD external subset.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
286N/A throws XNIException {
286N/A } // startExternalSubset(Augmentations)
286N/A
286N/A /**
286N/A * The end of the DTD external subset.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endExternalSubset(Augmentations augmentations)
286N/A throws XNIException {
286N/A } // endExternalSubset(Augmentations)
286N/A
286N/A /**
286N/A * This method notifies the start of an entity.
286N/A * <p>
286N/A * <strong>Note:</strong> This method is not called for entity references
286N/A * appearing as part of attribute values.
286N/A *
286N/A * @param name The name of the entity.
286N/A * @param identifier The resource identifier.
286N/A * @param encoding The auto-detected IANA encoding name of the entity
286N/A * stream. This value will be null in those situations
286N/A * where the entity encoding is not auto-detected (e.g.
286N/A * internal entities or a document entity that is
286N/A * parsed from a java.io.Reader).
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startParameterEntity(String name,
286N/A XMLResourceIdentifier identifier,
286N/A String encoding,
286N/A Augmentations augs) throws XNIException {
286N/A } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
286N/A
286N/A /**
286N/A * This method notifies the end of an entity.
286N/A * <p>
286N/A * <strong>Note:</strong> This method is not called for entity references
286N/A * appearing as part of attribute values.
286N/A *
286N/A * @param name The name of the entity.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void endParameterEntity(String name, Augmentations augs)
286N/A throws XNIException {
286N/A } // endParameterEntity(String,Augmentations)
286N/A
286N/A /**
286N/A * Characters within an IGNORE conditional section.
286N/A *
286N/A * @param text The ignored text.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
286N/A } // ignoredCharacters(XMLString, Augmentations)
286N/A
286N/A /**
286N/A * An element declaration.
286N/A *
286N/A * @param name The name of the element.
286N/A * @param contentModel The element content model.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void elementDecl(String name, String contentModel, Augmentations augs)
286N/A throws XNIException {
286N/A } // elementDecl(String,String)
286N/A
286N/A /**
286N/A * The start of an attribute list.
286N/A *
286N/A * @param elementName The name of the element that this attribute
286N/A * list is associated with.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startAttlist(String elementName, Augmentations augs) throws XNIException {
286N/A } // startAttlist(String)
286N/A
286N/A /**
286N/A * An attribute declaration.
286N/A *
286N/A * @param elementName The name of the element that this attribute
286N/A * is associated with.
286N/A * @param attributeName The name of the attribute.
286N/A * @param type The attribute type. This value will be one of
286N/A * the following: "CDATA", "ENTITY", "ENTITIES",
286N/A * "ENUMERATION", "ID", "IDREF", "IDREFS",
286N/A * "NMTOKEN", "NMTOKENS", or "NOTATION".
286N/A * @param enumeration If the type has the value "ENUMERATION" or
286N/A * "NOTATION", this array holds the allowed attribute
286N/A * values; otherwise, this array is null.
286N/A * @param defaultType The attribute default type. This value will be
286N/A * one of the following: "#FIXED", "#IMPLIED",
286N/A * "#REQUIRED", or null.
286N/A * @param defaultValue The attribute default value, or null if no
286N/A * default value is specified.
286N/A * @param nonNormalizedDefaultValue The attribute default value with no normalization
286N/A * performed, or null if no default value is specified.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void attributeDecl(String elementName, String attributeName,
286N/A String type, String[] enumeration,
286N/A String defaultType, XMLString defaultValue,
286N/A XMLString nonNormalizedDefaultValue, Augmentations augs)
286N/A throws XNIException {
286N/A } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
286N/A
286N/A /**
286N/A * The end of an attribute list.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endAttlist(Augmentations augs) throws XNIException {
286N/A } // endAttlist()
286N/A
286N/A /**
286N/A * An internal entity declaration.
286N/A *
286N/A * @param name The name of the entity. Parameter entity names start with
286N/A * '%', whereas the name of a general entity is just the
286N/A * entity name.
286N/A * @param text The value of the entity.
286N/A * @param nonNormalizedText The non-normalized value of the entity. This
286N/A * value contains the same sequence of characters that was in
286N/A * the internal entity declaration, without any entity
286N/A * references expanded.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void internalEntityDecl(String name, XMLString text,
286N/A XMLString nonNormalizedText, Augmentations augs)
286N/A throws XNIException {
286N/A } // internalEntityDecl(String,XMLString,XMLString)
286N/A
286N/A /**
286N/A * An external entity declaration.
286N/A *
286N/A * @param name The name of the entity. Parameter entity names start
286N/A * with '%', whereas the name of a general entity is just
286N/A * the entity name.
286N/A * @param identifier An object containing all location information
286N/A * pertinent to this entity.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
286N/A Augmentations augs) throws XNIException {
286N/A } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
286N/A
286N/A /**
286N/A * An unparsed entity declaration.
286N/A *
286N/A * @param name The name of the entity.
286N/A * @param identifier An object containing all location information
286N/A * pertinent to this entity.
286N/A * @param notation The name of the notation.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
286N/A String notation, Augmentations augs) throws XNIException {
286N/A } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
286N/A
286N/A /**
286N/A * A notation declaration
286N/A *
286N/A * @param name The name of the notation.
286N/A * @param identifier An object containing all location information
286N/A * pertinent to this notation.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void notationDecl(String name, XMLResourceIdentifier identifier,
286N/A Augmentations augs)
286N/A throws XNIException {
286N/A } // notationDecl(String,XMLResourceIdentifier, Augmentations)
286N/A
286N/A /**
286N/A * The start of a conditional section.
286N/A *
286N/A * @param type The type of the conditional section. This value will
286N/A * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #CONDITIONAL_INCLUDE
286N/A * @see #CONDITIONAL_IGNORE
286N/A */
286N/A public void startConditional(short type, Augmentations augs) throws XNIException {
286N/A } // startConditional(short)
286N/A
286N/A /**
286N/A * The end of a conditional section.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endConditional(Augmentations augs) throws XNIException {
286N/A } // endConditional()
286N/A
286N/A /**
286N/A * The end of the DTD.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endDTD(Augmentations augs) throws XNIException {
286N/A fInDTD = false;
286N/A } // endDTD()
286N/A
286N/A // set the source of this handler
286N/A public void setDTDSource(XMLDTDSource source) {
286N/A fDTDSource = source;
286N/A }
286N/A
286N/A // return the source from which this handler derives its events
286N/A public XMLDTDSource getDTDSource() {
286N/A return fDTDSource;
286N/A }
286N/A
286N/A //
286N/A // XMLDTDContentModelHandler methods
286N/A //
286N/A
286N/A /**
286N/A * The start of a content model. Depending on the type of the content
286N/A * model, specific methods may be called between the call to the
286N/A * startContentModel method and the call to the endContentModel method.
286N/A *
286N/A * @param elementName The name of the element.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startContentModel(String elementName, Augmentations augs) throws XNIException {
286N/A } // startContentModel(String, Augmentations)
286N/A
286N/A /**
286N/A * A content model of ANY.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #empty
286N/A * @see #startGroup
286N/A */
286N/A public void any(Augmentations augs) throws XNIException {
286N/A } // any(Augmentations)
286N/A
286N/A /**
286N/A * A content model of EMPTY.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #any
286N/A * @see #startGroup
286N/A */
286N/A public void empty(Augmentations augs) throws XNIException {
286N/A } // empty(Augmentations)
286N/A
286N/A /**
286N/A * A start of either a mixed or children content model. A mixed
286N/A * content model will immediately be followed by a call to the
286N/A * <code>pcdata()</code> method. A children content model will
286N/A * contain additional groups and/or elements.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #any
286N/A * @see #empty
286N/A */
286N/A public void startGroup(Augmentations augs) throws XNIException {
286N/A } // stargGroup(Augmentations)
286N/A
286N/A /**
286N/A * The appearance of "#PCDATA" within a group signifying a
286N/A * mixed content model. This method will be the first called
286N/A * following the content model's <code>startGroup()</code>.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #startGroup
286N/A */
286N/A public void pcdata(Augmentations augs) throws XNIException {
286N/A } // pcdata(Augmentations)
286N/A
286N/A /**
286N/A * A referenced element in a mixed or children content model.
286N/A *
286N/A * @param elementName The name of the referenced element.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void element(String elementName, Augmentations augs) throws XNIException {
286N/A } // element(String, Augmentations)
286N/A
286N/A /**
286N/A * The separator between choices or sequences of a mixed or children
286N/A * content model.
286N/A *
286N/A * @param separator The type of children separator.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #SEPARATOR_CHOICE
286N/A * @see #SEPARATOR_SEQUENCE
286N/A */
286N/A public void separator(short separator, Augmentations augs) throws XNIException {
286N/A } // separator(short, Augmentations)
286N/A
286N/A /**
286N/A * The occurrence count for a child in a children content model or
286N/A * for the mixed content model group.
286N/A *
286N/A * @param occurrence The occurrence count for the last element
286N/A * or group.
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #OCCURS_ZERO_OR_ONE
286N/A * @see #OCCURS_ZERO_OR_MORE
286N/A * @see #OCCURS_ONE_OR_MORE
286N/A */
286N/A public void occurrence(short occurrence, Augmentations augs) throws XNIException {
286N/A } // occurence(short, Augmentations)
286N/A
286N/A /**
286N/A * The end of a group for mixed or children content models.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endGroup(Augmentations augs) throws XNIException {
286N/A } // endGroup(Augmentations)
286N/A
286N/A /**
286N/A * The end of a content model.
286N/A *
286N/A * @param augs Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endContentModel(Augmentations augs) throws XNIException {
286N/A } // endContentModel(Augmentations)
286N/A
286N/A // set content model source
286N/A public void setDTDContentModelSource(XMLDTDContentModelSource source) {
286N/A fDTDContentModelSource = source;
286N/A }
286N/A
286N/A // get content model source
286N/A public XMLDTDContentModelSource getDTDContentModelSource() {
286N/A return fDTDContentModelSource;
286N/A }
286N/A
286N/A //
286N/A // Protected methods
286N/A //
286N/A
286N/A /**
286N/A * reset all components before parsing
286N/A */
286N/A protected void reset() throws XNIException {
286N/A super.reset();
286N/A fInDTD = false;
286N/A } // reset()
286N/A
286N/A} // class AbstractXMLDocumentParser