Home » Xerces-J-src.2.9.1 » org.apache.xerces » parsers » [javadoc | source]
org.apache.xerces.parsers
public class: AbstractDOMParser [javadoc | source]
java.lang.Object
   org.apache.xerces.parsers.XMLParser
      org.apache.xerces.parsers.AbstractXMLDocumentParser
         org.apache.xerces.parsers.AbstractDOMParser

All Implemented Interfaces:
    XMLDocumentHandler, XMLDTDContentModelHandler, XMLDTDHandler

Direct Known Subclasses:
    DOMParser, DOMAddLines, DOMParserImpl, DOMASBuilderImpl, DOMParserSaveEncoding, RevalidatingDOMParser

This is the base class of all DOM parsers. It implements the XNI callback methods to create the DOM tree. After a successful parse of an XML document, the DOM Document object can be queried using the getDocument method. The actual pipeline is defined in parser configuration.
Field Summary
protected static final  String NAMESPACES    Feature id: namespace. 
protected static final  String CREATE_ENTITY_REF_NODES    Feature id: create entity ref nodes. 
protected static final  String INCLUDE_COMMENTS_FEATURE    Feature id: include comments. 
protected static final  String CREATE_CDATA_NODES_FEATURE    Feature id: create cdata nodes. 
protected static final  String INCLUDE_IGNORABLE_WHITESPACE    Feature id: include ignorable whitespace. 
protected static final  String DEFER_NODE_EXPANSION    Feature id: defer node expansion. 
protected static final  String DOCUMENT_CLASS_NAME    Property id: document class name. 
protected static final  String CURRENT_ELEMENT_NODE     
protected static final  String DEFAULT_DOCUMENT_CLASS_NAME    Default document class name. 
protected static final  String CORE_DOCUMENT_CLASS_NAME     
protected static final  String PSVI_DOCUMENT_CLASS_NAME     
protected static final  RuntimeException ABORT    If the user stops the process, this exception will be thrown. 
protected  DOMErrorHandlerWrapper fErrorHandler    DOM L3 error handler 
protected  boolean fInDTD    True if inside DTD. 
protected  boolean fCreateEntityRefNodes    Create entity reference nodes. 
protected  boolean fIncludeIgnorableWhitespace    Include ignorable whitespace. 
protected  boolean fIncludeComments    Include Comments. 
protected  boolean fCreateCDATANodes    Create cdata nodes. 
protected  Document fDocument    The document. 
protected  CoreDocumentImpl fDocumentImpl    The default Xerces document implementation, if used. 
protected  boolean fStorePSVI    Whether to store PSVI information in DOM tree. 
protected  String fDocumentClassName    The document class name to use. 
protected  DocumentType fDocumentType    The document type node. 
protected  Node fCurrentNode    Current node. 
protected  CDATASection fCurrentCDATASection     
protected  EntityImpl fCurrentEntityDecl     
protected  int fDeferredEntityDecl     
protected final  StringBuffer fStringBuffer    Character buffer 
protected  StringBuffer fInternalSubset    Internal subset buffer. 
protected  boolean fDeferNodeExpansion     
protected  boolean fNamespaceAware     
protected  DeferredDocumentImpl fDeferredDocumentImpl     
protected  int fDocumentIndex     
protected  int fDocumentTypeIndex     
protected  int fCurrentNodeIndex     
protected  int fCurrentCDATASectionIndex     
protected  boolean fInDTDExternalSubset    True if inside DTD external subset. 
protected  QName fRoot    Root element name 
protected  boolean fInCDATASection    True if inside CDATA section. 
protected  boolean fFirstChunk    True if saw the first chunk of characters 
protected  boolean fFilterReject    LSParserFilter: specifies that element with given QNAME and all its children must be rejected 
protected  Stack fBaseURIStack    Base uri stack 
protected final  QName fRejectedElement    LSParserFilter: the QNAME of rejected element 
protected  Stack fSkippedElemStack    LSParserFilter: store qnames of skipped elements 
protected  boolean fInEntityRef    LSParserFilter: true if inside entity reference 
protected  LSParserFilter fDOMFilter     
Fields inherited from org.apache.xerces.parsers.AbstractXMLDocumentParser:
fInDTD,  fDocumentSource,  fDTDSource,  fDTDContentModelSource
Fields inherited from org.apache.xerces.parsers.XMLParser:
ENTITY_RESOLVER,  ERROR_HANDLER,  fConfiguration
Constructor:
 protected AbstractDOMParser(XMLParserConfiguration config) 
    Default constructor.
Method from org.apache.xerces.parsers.AbstractDOMParser Summary:
abort,   attributeDecl,   characters,   comment,   createAttrNode,   createElementNode,   doctypeDecl,   dropDocumentReferences,   elementDecl,   emptyElement,   endAttlist,   endCDATA,   endConditional,   endDTD,   endDocument,   endElement,   endExternalSubset,   endGeneralEntity,   endParameterEntity,   externalEntityDecl,   getDocument,   getDocumentClassName,   handleBaseURI,   handleBaseURI,   ignorableWhitespace,   ignoredCharacters,   internalEntityDecl,   notationDecl,   processingInstruction,   reset,   setCharacterData,   setDocumentClassName,   setLocale,   startAttlist,   startCDATA,   startConditional,   startDTD,   startDocument,   startElement,   startExternalSubset,   startGeneralEntity,   startParameterEntity,   textDecl,   unparsedEntityDecl,   xmlDecl
Methods from org.apache.xerces.parsers.AbstractXMLDocumentParser:
any,   attributeDecl,   characters,   comment,   doctypeDecl,   element,   elementDecl,   empty,   emptyElement,   endAttlist,   endCDATA,   endConditional,   endContentModel,   endDTD,   endDocument,   endElement,   endExternalSubset,   endGeneralEntity,   endGroup,   endParameterEntity,   externalEntityDecl,   getDTDContentModelSource,   getDTDSource,   getDocumentSource,   ignorableWhitespace,   ignoredCharacters,   internalEntityDecl,   notationDecl,   occurrence,   pcdata,   processingInstruction,   reset,   separator,   setDTDContentModelSource,   setDTDSource,   setDocumentSource,   startAttlist,   startCDATA,   startConditional,   startContentModel,   startDTD,   startDocument,   startElement,   startExternalSubset,   startGeneralEntity,   startGroup,   startParameterEntity,   textDecl,   unparsedEntityDecl,   xmlDecl
Methods from org.apache.xerces.parsers.XMLParser:
parse,   reset
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xerces.parsers.AbstractDOMParser Detail:
 public  void abort() 
 public  void attributeDecl(String elementName,
    String attributeName,
    String type,
    String[] enumeration,
    String defaultType,
    XMLString defaultValue,
    XMLString nonNormalizedDefaultValue,
    Augmentations augs) throws XNIException 
    An attribute declaration.
 public  void characters(XMLString text,
    Augmentations augs) throws XNIException 
    Character content.
 public  void comment(XMLString text,
    Augmentations augs) throws XNIException 
    A comment.
 protected Attr createAttrNode(QName attrQName) 
 protected Element createElementNode(QName element) 
 public  void doctypeDecl(String rootElement,
    String publicId,
    String systemId,
    Augmentations augs) throws XNIException 
    Notifies of the presence of the DOCTYPE line in the document.
 public final  void dropDocumentReferences() 
    Drops all references to the last DOM which was built by this parser.
 public  void elementDecl(String name,
    String contentModel,
    Augmentations augs) throws XNIException 
    An element declaration.
 public  void emptyElement(QName element,
    XMLAttributes attributes,
    Augmentations augs) throws XNIException 
    An empty element.
 public  void endAttlist(Augmentations augs) throws XNIException 
    The end of an attribute list.
 public  void endCDATA(Augmentations augs) throws XNIException 
    The end of a CDATA section.
 public  void endConditional(Augmentations augs) throws XNIException 
    The end of a conditional section.
 public  void endDTD(Augmentations augs) throws XNIException 
    The end of the DTD.
 public  void endDocument(Augmentations augs) throws XNIException 
    The end of the document.
 public  void endElement(QName element,
    Augmentations augs) throws XNIException 
    The end of an element.
 public  void endExternalSubset(Augmentations augs) throws XNIException 
    The end of the DTD external subset.
 public  void endGeneralEntity(String name,
    Augmentations augs) throws XNIException 
    This method notifies the end of a general entity.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void endParameterEntity(String name,
    Augmentations augs) throws XNIException 
    This method notifies the end of a parameter entity. Parameter entity names begin with a '%' character.
 public  void externalEntityDecl(String name,
    XMLResourceIdentifier identifier,
    Augmentations augs) throws XNIException 
    An external entity declaration.
 public Document getDocument() 
    Returns the DOM document object.
 protected String getDocumentClassName() 
    This method retreives the name of current document class.
 protected final  void handleBaseURI(Node node) 
    Record baseURI information for the Element (by adding xml:base attribute) or for the ProcessingInstruction (by setting a baseURI field) Non deferred DOM.
 protected final  void handleBaseURI(int node) 
    Record baseURI information for the Element (by adding xml:base attribute) or for the ProcessingInstruction (by setting a baseURI field) Deferred DOM.
 public  void ignorableWhitespace(XMLString text,
    Augmentations augs) throws XNIException 
    Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
 public  void ignoredCharacters(XMLString text,
    Augmentations augs) throws XNIException 
    Characters within an IGNORE conditional section.
 public  void internalEntityDecl(String name,
    XMLString text,
    XMLString nonNormalizedText,
    Augmentations augs) throws XNIException 
    An internal entity declaration.
 public  void notationDecl(String name,
    XMLResourceIdentifier identifier,
    Augmentations augs) throws XNIException 
    A notation declaration
 public  void processingInstruction(String target,
    XMLString data,
    Augmentations augs) throws XNIException 
    A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.

    Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.

 public  void reset() throws XNIException 
    Resets the parser state.
 protected  void setCharacterData(boolean sawChars) 
 protected  void setDocumentClassName(String documentClassName) 
    This method allows the programmer to decide which document factory to use when constructing the DOM tree. However, doing so will lose the functionality of the default factory. Also, a document class other than the default will lose the ability to defer node expansion on the DOM tree produced.
 public  void setLocale(Locale locale) 
    Set the locale to use for messages.
 public  void startAttlist(String elementName,
    Augmentations augs) throws XNIException 
    The start of an attribute list.
 public  void startCDATA(Augmentations augs) throws XNIException 
    The start of a CDATA section.
 public  void startConditional(short type,
    Augmentations augs) throws XNIException 
    The start of a conditional section.
 public  void startDTD(XMLLocator locator,
    Augmentations augs) throws XNIException 
    The start of the DTD.
 public  void startDocument(XMLLocator locator,
    String encoding,
    NamespaceContext namespaceContext,
    Augmentations augs) throws XNIException 
    The start of the document.
 public  void startElement(QName element,
    XMLAttributes attributes,
    Augmentations augs) throws XNIException 
    The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods.
 public  void startExternalSubset(XMLResourceIdentifier identifier,
    Augmentations augs) throws XNIException 
    The start of the DTD external subset.
 public  void startGeneralEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    This method notifies the start of a general entity.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void startParameterEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    This method notifies of the start of a parameter entity. The parameter entity name start with a '%' character.
 public  void textDecl(String version,
    String encoding,
    Augmentations augs) throws XNIException 
    Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startEntity call.

    Note: This method will never be called for the document entity; it is only called for external general entities referenced in document content.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void unparsedEntityDecl(String name,
    XMLResourceIdentifier identifier,
    String notation,
    Augmentations augs) throws XNIException 
    An unparsed entity declaration.
 public  void xmlDecl(String version,
    String encoding,
    String standalone,
    Augmentations augs) throws XNIException 
    Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.