Save This Page
Home » Xerces-J-src.2.9.1 » org.apache.xerces » parsers » [javadoc | source]
    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    * 
    9    *      http://www.apache.org/licenses/LICENSE-2.0
   10    * 
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   
   18   package org.apache.xerces.parsers;
   19   
   20   import org.apache.xerces.xni.Augmentations;
   21   import org.apache.xerces.xni.NamespaceContext;
   22   import org.apache.xerces.xni.QName;
   23   import org.apache.xerces.xni.XMLAttributes;
   24   import org.apache.xerces.xni.XMLDTDContentModelHandler;
   25   import org.apache.xerces.xni.XMLDTDHandler;
   26   import org.apache.xerces.xni.XMLDocumentHandler;
   27   import org.apache.xerces.xni.XMLLocator;
   28   import org.apache.xerces.xni.XMLResourceIdentifier;
   29   import org.apache.xerces.xni.XMLString;
   30   import org.apache.xerces.xni.XNIException;
   31   import org.apache.xerces.xni.parser.XMLDTDContentModelSource;
   32   import org.apache.xerces.xni.parser.XMLDTDSource;
   33   import org.apache.xerces.xni.parser.XMLDocumentSource;
   34   import org.apache.xerces.xni.parser.XMLParserConfiguration;
   35   
   36   /**
   37    * This is the base class for all XML document parsers. XMLDocumentParser
   38    * provides a common implementation shared by the various document parsers
   39    * in the Xerces package. While this class is provided for convenience, it
   40    * does not prevent other kinds of parsers to be constructed using the XNI
   41    * interfaces.
   42    *
   43    * @author Arnaud  Le Hors, IBM
   44    * @author Andy Clark, IBM
   45    *
   46    * @version $Id: AbstractXMLDocumentParser.java 447239 2006-09-18 05:08:26Z mrglavas $
   47    */
   48   public abstract class AbstractXMLDocumentParser
   49       extends XMLParser
   50       implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
   51   
   52       //
   53       // Data
   54       //
   55   
   56       // state
   57   
   58       /** True if inside DTD. */
   59       protected boolean fInDTD;
   60   
   61       /** Document source*/
   62       protected XMLDocumentSource fDocumentSource;
   63   
   64       /** DTD source*/
   65       protected XMLDTDSource fDTDSource;
   66   
   67       /** DTD content model source*/
   68       protected XMLDTDContentModelSource fDTDContentModelSource;
   69   
   70       //
   71       // Constructors
   72       //
   73   
   74       /**
   75        * Constructs a document parser using the default symbol table
   76        * and grammar pool.
   77        */
   78       protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
   79           super(config);
   80   
   81           // set handlers
   82           config.setDocumentHandler(this);
   83           config.setDTDHandler(this);
   84           config.setDTDContentModelHandler(this);
   85   
   86       } // <init>(XMLParserConfiguration)
   87   
   88       //
   89       // XMLDocumentHandler methods
   90       //
   91   
   92       /**
   93        * The start of the document.
   94        *
   95        * @param locator The system identifier of the entity if the entity
   96        *                 is external, null otherwise.
   97        * @param encoding The auto-detected IANA encoding name of the entity
   98        *                 stream. This value will be null in those situations
   99        *                 where the entity encoding is not auto-detected (e.g.
  100        *                 internal entities or a document entity that is
  101        *                 parsed from a java.io.Reader). 
  102        * @param namespaceContext
  103        *                 The namespace context in effect at the
  104        *                 start of this document.
  105        *                 This object represents the current context.
  106        *                 Implementors of this class are responsible
  107        *                 for copying the namespace bindings from the
  108        *                 the current context (and its parent contexts)
  109        *                 if that information is important.
  110        * @param augs   Additional information that may include infoset augmentations    
  111        *     
  112        * @throws XNIException Thrown by handler to signal an error.
  113        */
  114   
  115       public void startDocument(XMLLocator locator, String encoding, 
  116                                 NamespaceContext namespaceContext, Augmentations augs) 
  117           throws XNIException {
  118       } // startDocument(XMLLocator,String)
  119   
  120       /**
  121        * Notifies of the presence of an XMLDecl line in the document. If
  122        * present, this method will be called immediately following the
  123        * startDocument call.
  124        * 
  125        * @param version    The XML version.
  126        * @param encoding   The IANA encoding name of the document, or null if
  127        *                   not specified.
  128        * @param standalone The standalone value, or null if not specified.
  129        * @param augs   Additional information that may include infoset augmentations
  130        *
  131        * @throws XNIException Thrown by handler to signal an error.
  132        */
  133       public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
  134           throws XNIException {
  135       } // xmlDecl(String,String,String)
  136   
  137       /**
  138        * Notifies of the presence of the DOCTYPE line in the document.
  139        * 
  140        * @param rootElement The name of the root element.
  141        * @param publicId    The public identifier if an external DTD or null
  142        *                    if the external DTD is specified using SYSTEM.
  143        * @param systemId    The system identifier if an external DTD, null
  144        * @param augs   Additional information that may include infoset augmentations
  145        *                    otherwise.
  146        *
  147        * @throws XNIException Thrown by handler to signal an error.
  148        */
  149       public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
  150           throws XNIException {
  151       } // doctypeDecl(String,String,String)
  152   
  153       /**
  154        * The start of an element. If the document specifies the start element
  155        * by using an empty tag, then the startElement method will immediately
  156        * be followed by the endElement method, with no intervening methods.
  157        * 
  158        * @param element    The name of the element.
  159        * @param attributes The element attributes.
  160        * @param augs   Additional information that may include infoset augmentations
  161        *
  162        * @throws XNIException Thrown by handler to signal an error.
  163        */
  164       public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
  165           throws XNIException {
  166       } // startElement(QName,XMLAttributes)
  167   
  168       /**
  169        * An empty element.
  170        * 
  171        * @param element    The name of the element.
  172        * @param attributes The element attributes.
  173        * @param augs   Additional information that may include infoset augmentations
  174        *
  175        * @throws XNIException Thrown by handler to signal an error.
  176        */
  177       public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
  178           throws XNIException {
  179   
  180           startElement(element, attributes, augs);
  181           endElement(element, augs);
  182   
  183       } // emptyElement(QName,XMLAttributes)
  184   
  185       /**
  186        * Character content.
  187        * 
  188        * @param text The content.
  189        * @param augs   Additional information that may include infoset augmentations
  190        *
  191        * @throws XNIException Thrown by handler to signal an error.
  192        */
  193       public void characters(XMLString text, Augmentations augs) throws XNIException {
  194       } // characters(XMLString)
  195   
  196       /**
  197        * Ignorable whitespace. For this method to be called, the document
  198        * source must have some way of determining that the text containing
  199        * only whitespace characters should be considered ignorable. For
  200        * example, the validator can determine if a length of whitespace
  201        * characters in the document are ignorable based on the element
  202        * content model.
  203        * 
  204        * @param text The ignorable whitespace.
  205        * @param augs   Additional information that may include infoset augmentations
  206        *
  207        * @throws XNIException Thrown by handler to signal an error.
  208        */
  209       public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
  210       } // ignorableWhitespace(XMLString)
  211   
  212       /**
  213        * The end of an element.
  214        * 
  215        * @param element The name of the element.
  216        * @param augs   Additional information that may include infoset augmentations
  217        *
  218        * @throws XNIException Thrown by handler to signal an error.
  219        */
  220       public void endElement(QName element, Augmentations augs) throws XNIException {
  221       } // endElement(QName)
  222   
  223       /** 
  224        * The start of a CDATA section. 
  225        * @param augs   Additional information that may include infoset augmentations
  226        *
  227        * @throws XNIException Thrown by handler to signal an error.
  228        */
  229       public void startCDATA(Augmentations augs) throws XNIException {
  230       } // startCDATA()
  231   
  232       /**
  233        * The end of a CDATA section.
  234        * @param augs   Additional information that may include infoset augmentations 
  235        *
  236        * @throws XNIException Thrown by handler to signal an error.
  237        */
  238       public void endCDATA(Augmentations augs) throws XNIException {
  239       } // endCDATA()
  240   
  241       /**
  242        * The end of the document.
  243        * @param augs   Additional information that may include infoset augmentations
  244        *
  245        * @throws XNIException Thrown by handler to signal an error.
  246        */
  247       public void endDocument(Augmentations augs) throws XNIException {
  248       } // endDocument()
  249   
  250   
  251       /**
  252        * This method notifies the start of an entity.
  253        * <p>
  254        * <strong>Note:</strong> This method is not called for entity references
  255        * appearing as part of attribute values.
  256        * 
  257        * @param name     The name of the entity.
  258        * @param identifier The resource identifier.
  259        * @param encoding The auto-detected IANA encoding name of the entity
  260        *                 stream. This value will be null in those situations
  261        *                 where the entity encoding is not auto-detected (e.g.
  262        *                 internal entities or a document entity that is
  263        *                 parsed from a java.io.Reader).
  264        * @param augs     Additional information that may include infoset augmentations
  265        *                 
  266        * @exception XNIException Thrown by handler to signal an error.
  267        */
  268       public void startGeneralEntity(String name, 
  269                                      XMLResourceIdentifier identifier,
  270                                      String encoding,
  271                                      Augmentations augs) throws XNIException {
  272       } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
  273   
  274       /**
  275        * Notifies of the presence of a TextDecl line in an entity. If present,
  276        * this method will be called immediately following the startEntity call.
  277        * <p>
  278        * <strong>Note:</strong> This method will never be called for the
  279        * document entity; it is only called for external general entities
  280        * referenced in document content.
  281        * <p>
  282        * <strong>Note:</strong> This method is not called for entity references
  283        * appearing as part of attribute values.
  284        * 
  285        * @param version  The XML version, or null if not specified.
  286        * @param encoding The IANA encoding name of the entity.
  287        * @param augs     Additional information that may include infoset augmentations
  288        *                 
  289        * @exception XNIException
  290        *                   Thrown by handler to signal an error.
  291        */
  292       public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
  293       } // textDecl(String, String, Augmentations)
  294       
  295       /**
  296        * This method notifies the end of an entity.
  297        * <p>
  298        * <strong>Note:</strong> This method is not called for entity references
  299        * appearing as part of attribute values.
  300        * 
  301        * @param name   The name of the entity.
  302        * @param augs   Additional information that may include infoset augmentations
  303        *               
  304        * @exception XNIException
  305        *                   Thrown by handler to signal an error.
  306        */
  307       public void endGeneralEntity(String name, Augmentations augs) 
  308           throws XNIException {
  309       } // endGeneralEntity(String,Augmentations)
  310       
  311       /**
  312        * A comment.
  313        * 
  314        * @param text   The text in the comment.
  315        * @param augs   Additional information that may include infoset augmentations
  316        *               
  317        * @exception XNIException
  318        *                   Thrown by application to signal an error.
  319        */
  320       public void comment(XMLString text, Augmentations augs) throws XNIException {
  321       } // comment (XMLString, Augmentations)
  322   
  323       /**
  324        * A processing instruction. Processing instructions consist of a
  325        * target name and, optionally, text data. The data is only meaningful
  326        * to the application.
  327        * <p>
  328        * Typically, a processing instruction's data will contain a series
  329        * of pseudo-attributes. These pseudo-attributes follow the form of
  330        * element attributes but are <strong>not</strong> parsed or presented
  331        * to the application as anything other than text. The application is
  332        * responsible for parsing the data.
  333        * 
  334        * @param target The target.
  335        * @param data   The data or null if none specified.
  336        * @param augs   Additional information that may include infoset augmentations
  337        *               
  338        * @exception XNIException
  339        *                   Thrown by handler to signal an error.
  340        */
  341       public void processingInstruction(String target, XMLString data, Augmentations augs)
  342           throws XNIException {
  343       } // processingInstruction(String, XMLString, Augmentations)
  344   
  345       
  346       /** Sets the document source */
  347       public void setDocumentSource(XMLDocumentSource source){
  348           fDocumentSource = source;
  349       } // setDocumentSource
  350   
  351       /** Returns the document source */
  352       public XMLDocumentSource getDocumentSource (){
  353           return fDocumentSource;
  354       } // getDocumentSource
  355       //
  356       // XMLDTDHandler methods
  357       //
  358       
  359       /**
  360        * The start of the DTD.
  361        *
  362        * @param locator  The document locator, or null if the document
  363        *                 location cannot be reported during the parsing of 
  364        *                 the document DTD. However, it is <em>strongly</em>
  365        *                 recommended that a locator be supplied that can 
  366        *                 at least report the base system identifier of the
  367        *                 DTD.
  368        * @param augs Additional information that may include infoset
  369        *                      augmentations.
  370        *
  371        * @throws XNIException Thrown by handler to signal an error.
  372        */
  373       public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
  374           fInDTD = true;
  375       } // startDTD(XMLLocator)
  376   
  377   
  378       /**
  379        * The start of the DTD external subset.
  380        *
  381        * @param augmentations Additional information that may include infoset
  382        *                      augmentations.
  383        *
  384        * @throws XNIException Thrown by handler to signal an error.
  385        */
  386       public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations) 
  387           throws XNIException {
  388       } // startExternalSubset(Augmentations)
  389   
  390       /**
  391        * The end of the DTD external subset.
  392        *
  393        * @param augmentations Additional information that may include infoset
  394        *                      augmentations.
  395        *
  396        * @throws XNIException Thrown by handler to signal an error.
  397        */
  398       public void endExternalSubset(Augmentations augmentations) 
  399           throws XNIException {
  400       } // endExternalSubset(Augmentations)
  401   
  402       /**
  403        * This method notifies the start of an entity.
  404        * <p>
  405        * <strong>Note:</strong> This method is not called for entity references
  406        * appearing as part of attribute values.
  407        * 
  408        * @param name     The name of the entity.
  409        * @param identifier The resource identifier.
  410        * @param encoding The auto-detected IANA encoding name of the entity
  411        *                 stream. This value will be null in those situations
  412        *                 where the entity encoding is not auto-detected (e.g.
  413        *                 internal entities or a document entity that is
  414        *                 parsed from a java.io.Reader).
  415        * @param augs     Additional information that may include infoset augmentations
  416        *                 
  417        * @exception XNIException Thrown by handler to signal an error.
  418        */
  419       public void startParameterEntity(String name, 
  420                                        XMLResourceIdentifier identifier,
  421                                        String encoding,
  422                                        Augmentations augs) throws XNIException {
  423       } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
  424   
  425       /**
  426        * This method notifies the end of an entity.
  427        * <p>
  428        * <strong>Note:</strong> This method is not called for entity references
  429        * appearing as part of attribute values.
  430        * 
  431        * @param name   The name of the entity.
  432        * @param augs   Additional information that may include infoset augmentations
  433        *               
  434        * @exception XNIException
  435        *                   Thrown by handler to signal an error.
  436        */
  437       public void endParameterEntity(String name, Augmentations augs) 
  438           throws XNIException {
  439       } // endParameterEntity(String,Augmentations)
  440       
  441       /**
  442        * Characters within an IGNORE conditional section.
  443        *
  444        * @param text The ignored text.
  445        * @param augs Additional information that may include infoset
  446        *                      augmentations.
  447        *
  448        * @throws XNIException Thrown by handler to signal an error.
  449        */
  450        public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
  451        } // ignoredCharacters(XMLString, Augmentations)
  452   
  453       /**
  454        * An element declaration.
  455        * 
  456        * @param name         The name of the element.
  457        * @param contentModel The element content model.
  458        * @param augs Additional information that may include infoset
  459        *                      augmentations.
  460        *
  461        * @throws XNIException Thrown by handler to signal an error.
  462        */
  463       public void elementDecl(String name, String contentModel, Augmentations augs)
  464           throws XNIException {
  465       } // elementDecl(String,String)
  466   
  467       /**
  468        * The start of an attribute list.
  469        * 
  470        * @param elementName The name of the element that this attribute
  471        *                    list is associated with.
  472        * @param augs Additional information that may include infoset
  473        *                      augmentations.
  474        *
  475        * @throws XNIException Thrown by handler to signal an error.
  476        */
  477       public void startAttlist(String elementName, Augmentations augs) throws XNIException {
  478       } // startAttlist(String)
  479   
  480       /**
  481        * An attribute declaration.
  482        * 
  483        * @param elementName   The name of the element that this attribute
  484        *                      is associated with.
  485        * @param attributeName The name of the attribute.
  486        * @param type          The attribute type. This value will be one of
  487        *                      the following: "CDATA", "ENTITY", "ENTITIES",
  488        *                      "ENUMERATION", "ID", "IDREF", "IDREFS", 
  489        *                      "NMTOKEN", "NMTOKENS", or "NOTATION".
  490        * @param enumeration   If the type has the value "ENUMERATION" or
  491        *                      "NOTATION", this array holds the allowed attribute
  492        *                      values; otherwise, this array is null.
  493        * @param defaultType   The attribute default type. This value will be
  494        *                      one of the following: "#FIXED", "#IMPLIED",
  495        *                      "#REQUIRED", or null.
  496        * @param defaultValue  The attribute default value, or null if no
  497        *                      default value is specified.
  498        * @param nonNormalizedDefaultValue  The attribute default value with no normalization 
  499        *                      performed, or null if no default value is specified.
  500        * @param augs Additional information that may include infoset
  501        *                      augmentations.
  502        *
  503        * @throws XNIException Thrown by handler to signal an error.
  504        */
  505       public void attributeDecl(String elementName, String attributeName, 
  506                                 String type, String[] enumeration, 
  507                                 String defaultType, XMLString defaultValue, 
  508   			      XMLString nonNormalizedDefaultValue, Augmentations augs)
  509           throws XNIException {
  510       } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
  511   
  512       /**
  513        * The end of an attribute list.
  514        *
  515        * @param augs Additional information that may include infoset
  516        *                      augmentations.
  517        *
  518        * @throws XNIException Thrown by handler to signal an error.
  519        */
  520       public void endAttlist(Augmentations augs) throws XNIException {
  521       } // endAttlist()
  522   
  523       /**
  524        * An internal entity declaration.
  525        * 
  526        * @param name The name of the entity. Parameter entity names start with
  527        *             '%', whereas the name of a general entity is just the 
  528        *             entity name.
  529        * @param text The value of the entity.
  530        * @param nonNormalizedText The non-normalized value of the entity. This
  531        *             value contains the same sequence of characters that was in 
  532        *             the internal entity declaration, without any entity
  533        *             references expanded.
  534        * @param augs Additional information that may include infoset
  535        *                      augmentations.
  536        *
  537        * @throws XNIException Thrown by handler to signal an error.
  538        */
  539       public void internalEntityDecl(String name, XMLString text,
  540                                      XMLString nonNormalizedText, Augmentations augs) 
  541           throws XNIException {
  542       } // internalEntityDecl(String,XMLString,XMLString)
  543   
  544       /**
  545        * An external entity declaration.
  546        * 
  547        * @param name     The name of the entity. Parameter entity names start
  548        *                 with '%', whereas the name of a general entity is just
  549        *                 the entity name.
  550        * @param identifier    An object containing all location information 
  551        *                      pertinent to this entity.
  552        * @param augs Additional information that may include infoset
  553        *                      augmentations.
  554        *
  555        * @throws XNIException Thrown by handler to signal an error.
  556        */
  557       public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
  558                                      Augmentations augs) throws XNIException {
  559       } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
  560   
  561       /**
  562        * An unparsed entity declaration.
  563        * 
  564        * @param name     The name of the entity.
  565        * @param identifier    An object containing all location information 
  566        *                      pertinent to this entity.
  567        * @param notation The name of the notation.
  568        * @param augs Additional information that may include infoset
  569        *                      augmentations.
  570        *
  571        * @throws XNIException Thrown by handler to signal an error.
  572        */
  573       public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
  574                                      String notation, Augmentations augs) throws XNIException {
  575       } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
  576   
  577       /**
  578        * A notation declaration
  579        * 
  580        * @param name     The name of the notation.
  581        * @param identifier    An object containing all location information 
  582        *                      pertinent to this notation.
  583        * @param augs Additional information that may include infoset
  584        *                      augmentations.
  585        *
  586        * @throws XNIException Thrown by handler to signal an error.
  587        */
  588       public void notationDecl(String name, XMLResourceIdentifier identifier, 
  589       	Augmentations augs)
  590           throws XNIException {
  591       } // notationDecl(String,XMLResourceIdentifier, Augmentations)
  592   
  593       /**
  594        * The start of a conditional section.
  595        * 
  596        * @param type The type of the conditional section. This value will
  597        *             either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
  598        * @param augs Additional information that may include infoset
  599        *                      augmentations.
  600        *
  601        * @throws XNIException Thrown by handler to signal an error.
  602        *
  603        * @see #CONDITIONAL_INCLUDE
  604        * @see #CONDITIONAL_IGNORE
  605        */
  606       public void startConditional(short type, Augmentations augs) throws XNIException  {
  607       } // startConditional(short)
  608   
  609       /**
  610        * The end of a conditional section.
  611        *
  612        * @param augs Additional information that may include infoset
  613        *                      augmentations.
  614        *
  615        * @throws XNIException Thrown by handler to signal an error.
  616        */
  617       public void endConditional(Augmentations augs) throws XNIException {
  618       } // endConditional()
  619   
  620       /**
  621        * The end of the DTD.
  622        *
  623        * @param augs Additional information that may include infoset
  624        *                      augmentations.
  625        *
  626        * @throws XNIException Thrown by handler to signal an error.
  627        */
  628       public void endDTD(Augmentations augs) throws XNIException {
  629           fInDTD = false;
  630       } // endDTD()
  631   
  632       // set the source of this handler
  633       public void setDTDSource(XMLDTDSource source) {
  634           fDTDSource = source;
  635       }
  636   
  637       // return the source from which this handler derives its events
  638       public XMLDTDSource getDTDSource() {
  639           return fDTDSource;
  640       }
  641   
  642       //
  643       // XMLDTDContentModelHandler methods
  644       //
  645   
  646       /**
  647        * The start of a content model. Depending on the type of the content
  648        * model, specific methods may be called between the call to the
  649        * startContentModel method and the call to the endContentModel method.
  650        * 
  651        * @param elementName The name of the element.
  652        * @param augs Additional information that may include infoset
  653        *                      augmentations.
  654        *
  655        * @throws XNIException Thrown by handler to signal an error.
  656        */
  657       public void startContentModel(String elementName, Augmentations augs) throws XNIException {
  658       } // startContentModel(String, Augmentations)
  659   
  660       /** 
  661        * A content model of ANY. 
  662        *
  663        * @param augs Additional information that may include infoset
  664        *                      augmentations.
  665        *
  666        * @throws XNIException Thrown by handler to signal an error.
  667        *
  668        * @see #empty
  669        * @see #startGroup
  670        */
  671       public void any(Augmentations augs) throws XNIException {
  672       } // any(Augmentations)
  673   
  674       /**
  675        * A content model of EMPTY.
  676        *
  677        * @param augs Additional information that may include infoset
  678        *                      augmentations.
  679        *
  680        * @throws XNIException Thrown by handler to signal an error.
  681        *
  682        * @see #any
  683        * @see #startGroup
  684        */
  685       public void empty(Augmentations augs) throws XNIException {
  686       } // empty(Augmentations)
  687   
  688       /**
  689        * A start of either a mixed or children content model. A mixed
  690        * content model will immediately be followed by a call to the
  691        * <code>pcdata()</code> method. A children content model will
  692        * contain additional groups and/or elements.
  693        *
  694        * @param augs Additional information that may include infoset
  695        *                      augmentations.
  696        *
  697        * @throws XNIException Thrown by handler to signal an error.
  698        *
  699        * @see #any
  700        * @see #empty
  701        */
  702       public void startGroup(Augmentations augs) throws XNIException {
  703       } // stargGroup(Augmentations)
  704   
  705       /**
  706        * The appearance of "#PCDATA" within a group signifying a
  707        * mixed content model. This method will be the first called
  708        * following the content model's <code>startGroup()</code>.
  709        *
  710        * @param augs Additional information that may include infoset
  711        *                      augmentations.
  712        *     
  713        * @throws XNIException Thrown by handler to signal an error.
  714        *
  715        * @see #startGroup
  716        */
  717       public void pcdata(Augmentations augs) throws XNIException {
  718       } // pcdata(Augmentations)
  719   
  720       /**
  721        * A referenced element in a mixed or children content model.
  722        * 
  723        * @param elementName The name of the referenced element.
  724        * @param augs Additional information that may include infoset
  725        *                      augmentations.
  726        *
  727        * @throws XNIException Thrown by handler to signal an error.
  728        */
  729       public void element(String elementName, Augmentations augs) throws XNIException {
  730       } // element(String, Augmentations)
  731   
  732       /**
  733        * The separator between choices or sequences of a mixed or children
  734        * content model.
  735        * 
  736        * @param separator The type of children separator.
  737        * @param augs Additional information that may include infoset
  738        *                      augmentations.
  739        *
  740        * @throws XNIException Thrown by handler to signal an error.
  741        *
  742        * @see #SEPARATOR_CHOICE
  743        * @see #SEPARATOR_SEQUENCE
  744        */
  745       public void separator(short separator, Augmentations augs) throws XNIException {
  746       } // separator(short, Augmentations)
  747   
  748       /**
  749        * The occurrence count for a child in a children content model or
  750        * for the mixed content model group.
  751        * 
  752        * @param occurrence The occurrence count for the last element
  753        *                   or group.
  754        * @param augs Additional information that may include infoset
  755        *                      augmentations.
  756        *
  757        * @throws XNIException Thrown by handler to signal an error.
  758        *
  759        * @see #OCCURS_ZERO_OR_ONE
  760        * @see #OCCURS_ZERO_OR_MORE
  761        * @see #OCCURS_ONE_OR_MORE
  762        */
  763       public void occurrence(short occurrence, Augmentations augs) throws XNIException {
  764       } // occurence(short, Augmentations)
  765   
  766       /**
  767        * The end of a group for mixed or children content models.
  768        *
  769        * @param augs Additional information that may include infoset
  770        *                      augmentations.
  771        *
  772        * @throws XNIException Thrown by handler to signal an error.
  773        */
  774       public void endGroup(Augmentations augs) throws XNIException {
  775       } // endGroup(Augmentations)
  776   
  777       /**
  778        * The end of a content model.
  779        *
  780        * @param augs Additional information that may include infoset
  781        *                      augmentations.
  782        *
  783        * @throws XNIException Thrown by handler to signal an error.
  784        */
  785       public void endContentModel(Augmentations augs) throws XNIException {
  786       } // endContentModel(Augmentations)
  787   
  788       // set content model source
  789       public void setDTDContentModelSource(XMLDTDContentModelSource source) {
  790           fDTDContentModelSource = source;
  791       }
  792   
  793       // get content model source
  794       public XMLDTDContentModelSource getDTDContentModelSource() {
  795           return fDTDContentModelSource;
  796       }
  797   
  798       //
  799       // Protected methods
  800       //
  801   
  802       /**
  803        * reset all components before parsing
  804        */
  805       protected void reset() throws XNIException {
  806           super.reset();
  807           fInDTD = false;
  808       } // reset()
  809   
  810   } // class AbstractXMLDocumentParser

Save This Page
Home » Xerces-J-src.2.9.1 » org.apache.xerces » parsers » [javadoc | source]