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

Save This Page
Home » openjdk-7 » com.sun.org.apache.xerces.internal » parsers » [javadoc | source]