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

All Implemented Interfaces:
    Parser, PSVIProvider, XMLReader, XMLDocumentHandler, XMLDTDContentModelHandler, XMLDTDHandler

Direct Known Subclasses:
    PSVIParser, SAXParser, JAXPSAXParser, CSVParser

This is the base class of all SAX parsers. It implements both the SAX1 and SAX2 parser functionality, while the actual pipeline is defined in the parser configuration.
Nested Class Summary:
protected static final class  AbstractSAXParser.LocatorProxy   
protected static final class  AbstractSAXParser.AttributesProxy   
Field Summary
protected static final  String NAMESPACES    Feature identifier: namespaces. 
protected static final  String STRING_INTERNING    Feature id: string interning. 
protected static final  String ALLOW_UE_AND_NOTATION_EVENTS    Feature identifier: allow notation and unparsed entity events to be sent out of order. 
protected static final  String LEXICAL_HANDLER    Property id: lexical handler. 
protected static final  String DECLARATION_HANDLER    Property id: declaration handler. 
protected static final  String DOM_NODE    Property id: DOM node. 
protected  boolean fNamespaces    Namespaces. 
protected  boolean fNamespacePrefixes    Namespace prefixes. 
protected  boolean fLexicalHandlerParameterEntities    Lexical handler parameter entities. 
protected  boolean fStandalone    Standalone document declaration. 
protected  boolean fResolveDTDURIs    Resolve DTD URIs. 
protected  boolean fUseEntityResolver2    Use EntityResolver2. 
protected  boolean fXMLNSURIs    XMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace. 
protected  ContentHandler fContentHandler    Content handler. 
protected  DocumentHandler fDocumentHandler    Document handler. 
protected  NamespaceContext fNamespaceContext    Namespace context 
protected  DTDHandler fDTDHandler    DTD handler. 
protected  DeclHandler fDeclHandler    Decl handler. 
protected  LexicalHandler fLexicalHandler    Lexical handler. 
protected  QName fQName     
protected  boolean fParseInProgress    True if a parse is in progress. This state is needed because some features/properties cannot be set while parsing (e.g. validation and namespaces). 
protected  String fVersion     
protected  SymbolHash fDeclaredAttrs     
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 AbstractSAXParser(XMLParserConfiguration config) 
    Default constructor.
Method from org.apache.xerces.parsers.AbstractSAXParser Summary:
attributeDecl,   characters,   comment,   doctypeDecl,   elementDecl,   endCDATA,   endDTD,   endDocument,   endElement,   endExternalSubset,   endGeneralEntity,   endNamespaceMapping,   endParameterEntity,   externalEntityDecl,   getAttributePSVI,   getAttributePSVIByName,   getContentHandler,   getDTDHandler,   getDeclHandler,   getElementPSVI,   getEntityResolver,   getErrorHandler,   getFeature,   getLexicalHandler,   getProperty,   ignorableWhitespace,   internalEntityDecl,   notationDecl,   parse,   parse,   processingInstruction,   reset,   setContentHandler,   setDTDHandler,   setDeclHandler,   setDocumentHandler,   setEntityResolver,   setErrorHandler,   setFeature,   setLexicalHandler,   setLocale,   setProperty,   startCDATA,   startDocument,   startElement,   startExternalSubset,   startGeneralEntity,   startNamespaceMapping,   startParameterEntity,   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.AbstractSAXParser Detail:
 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.
 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  void elementDecl(String name,
    String contentModel,
    Augmentations augs) throws XNIException 
    An element declaration.
 public  void endCDATA(Augmentations augs) throws XNIException 
    The end of a CDATA 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 an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

    Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

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

 protected final  void endNamespaceMapping() throws SAXException 
    Send endPrefixMapping events
 public  void endParameterEntity(String name,
    Augmentations augs) throws XNIException 
    This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

    Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

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

 public  void externalEntityDecl(String name,
    XMLResourceIdentifier identifier,
    Augmentations augs) throws XNIException 
    An external entity declaration.
 public AttributePSVI getAttributePSVI(int index) 
 public AttributePSVI getAttributePSVIByName(String uri,
    String localname) 
 public ContentHandler getContentHandler() 
    Return the current content handler.
 public DTDHandler getDTDHandler() 
    Return the current DTD handler.
 protected DeclHandler getDeclHandler() throws SAXNotSupportedException, SAXNotRecognizedException 
    Returns the DTD declaration event handler.
 public ElementPSVI getElementPSVI() 
 public EntityResolver getEntityResolver() 
    Return the current entity resolver.
 public ErrorHandler getErrorHandler() 
    Return the current error handler.
 public boolean getFeature(String featureId) throws SAXNotSupportedException, SAXNotRecognizedException 
    Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.
 protected LexicalHandler getLexicalHandler() throws SAXNotSupportedException, SAXNotRecognizedException 
    Returns the lexical handler.
 public Object getProperty(String propertyId) throws SAXNotSupportedException, SAXNotRecognizedException 
    Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.
 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 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 parse(String systemId) throws IOException, SAXException 
    Parses the input source specified by the given system identifier.

    This method is equivalent to the following:

    parse(new InputSource(systemId));
    
 public  void parse(InputSource inputSource) throws IOException, SAXException 
    parse
 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 
    Reset all components before parsing.
 public  void setContentHandler(ContentHandler contentHandler) 
    Allow an application to register a content event handler.

    If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

    Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

 public  void setDTDHandler(DTDHandler dtdHandler) 
    Allow an application to register a DTD event handler.

    If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.

    Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

 protected  void setDeclHandler(DeclHandler handler) throws SAXNotSupportedException, SAXNotRecognizedException 
    Set the DTD declaration event handler.

    This method is the equivalent to the property:

    http://xml.org/sax/properties/declaration-handler
    
 public  void setDocumentHandler(DocumentHandler documentHandler) 
    Allow an application to register a document event handler.

    If the application does not register a document handler, all document events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by HandlerBase).

    Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

 public  void setEntityResolver(EntityResolver resolver) 
    Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.
 public  void setErrorHandler(ErrorHandler errorHandler) 
    Allow an application to register an error event handler.

    If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.

    Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

 public  void setFeature(String featureId,
    boolean state) throws SAXNotSupportedException, SAXNotRecognizedException 
    Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
 protected  void setLexicalHandler(LexicalHandler handler) throws SAXNotSupportedException, SAXNotRecognizedException 
    Set the lexical event handler.

    This method is the equivalent to the property:

    http://xml.org/sax/properties/lexical-handler
    
 public  void setLocale(Locale locale) throws SAXException 
    Set the locale to use for messages.
 public  void setProperty(String propertyId,
    Object value) throws SAXNotSupportedException, SAXNotRecognizedException 
    Set the value of any property in a SAX2 parser. The parser might not recognize the property, and if it does recognize it, it might not support the requested value.
 public  void startCDATA(Augmentations augs) throws XNIException 
    The start of a CDATA section.
 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 of the start of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

    Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

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

 protected final  void startNamespaceMapping() throws SAXException 
    Send startPrefixMapping events
 public  void startParameterEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    This method notifies of the start of parameter entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

    Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

    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.