Class AbstractSAXParser
- All Implemented Interfaces:
org.apache.xerces.xni.XMLDocumentHandler,org.apache.xerces.xni.XMLDTDContentModelHandler,org.apache.xerces.xni.XMLDTDHandler,org.apache.xerces.xs.PSVIProvider,Parser,XMLReader
- Direct Known Subclasses:
SAXParser
- Version:
- $Id: AbstractSAXParser.java 1135017 2011-06-13 03:31:26Z mrglavas $
- Author:
- Arnaud Le Hors, IBM, Andy Clark, IBM
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringFeature identifier: allow notation and unparsed entity events to be sent out of order.protected static final StringProperty id: declaration handler.protected static final StringProperty id: DOM node.protected ContentHandlerContent handler.protected SymbolHashprotected DeclHandlerDecl handler.protected DocumentHandlerDocument handler.protected DTDHandlerDTD handler.protected LexicalHandlerLexical handler.protected booleanLexical handler parameter entities.protected org.apache.xerces.xni.NamespaceContextNamespace contextprotected booleanNamespace prefixes.protected booleanNamespaces.protected booleanTrue if a parse is in progress.protected final org.apache.xerces.xni.QNameprotected booleanResolve DTD URIs.protected booleanStandalone document declaration.protected booleanUse EntityResolver2.protected Stringprotected booleanXMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace.protected static final StringProperty id: lexical handler.protected static final StringFeature identifier: namespaces.protected static final StringFeature id: string interning.Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
fDocumentSource, fDTDContentModelSource, fDTDSource, fInDTDFields inherited from class org.apache.xerces.parsers.XMLParser
ENTITY_RESOLVER, ERROR_HANDLER, fConfigurationFields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCEFields inherited from interface org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSAXParser(org.apache.xerces.xni.parser.XMLParserConfiguration config) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidattributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augs) An attribute declaration.voidcharacters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) Character content.voidcomment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) A comment.voiddoctypeDecl(String rootElement, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs) Notifies of the presence of the DOCTYPE line in the document.voidelementDecl(String name, String contentModel, org.apache.xerces.xni.Augmentations augs) An element declaration.voidendCDATA(org.apache.xerces.xni.Augmentations augs) The end of a CDATA section.voidendDocument(org.apache.xerces.xni.Augmentations augs) The end of the document.voidendDTD(org.apache.xerces.xni.Augmentations augs) The end of the DTD.voidendElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) The end of an element.voidendExternalSubset(org.apache.xerces.xni.Augmentations augs) The end of the DTD external subset.voidendGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs) This method notifies the end of an entity.protected final voidSend endPrefixMapping eventsvoidendParameterEntity(String name, org.apache.xerces.xni.Augmentations augs) This method notifies the end of an entity.voidexternalEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) An external entity declaration.org.apache.xerces.xs.AttributePSVIgetAttributePSVI(int index) ProvidesAttributePSVIgiven the index of an attribute information item in the current element's attribute list.org.apache.xerces.xs.AttributePSVIgetAttributePSVIByName(String uri, String localname) ProvidesAttributePSVIgiven the namespace name and the local name of an attribute information item in the current element's attribute list.Return the current content handler.protected DeclHandlerReturns the DTD declaration event handler.Return the current DTD handler.org.apache.xerces.xs.ElementPSVIProvides the post schema validation item for the current element information item.Return the current entity resolver.Return the current error handler.booleangetFeature(String featureId) Query the state of a feature.protected LexicalHandlerReturns the lexical handler.getProperty(String propertyId) Query the value of a property.voidignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) Ignorable whitespace.voidinternalEntityDecl(String name, org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.XMLString nonNormalizedText, org.apache.xerces.xni.Augmentations augs) An internal entity declaration.voidnotationDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) A notation declarationvoidParses the input source specified by the given system identifier.voidparse(InputSource inputSource) parsevoidprocessingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) A processing instruction.voidreset()Reset all components before parsing.voidsetContentHandler(ContentHandler contentHandler) Allow an application to register a content event handler.protected voidsetDeclHandler(DeclHandler handler) Set the DTD declaration event handler.voidsetDocumentHandler(DocumentHandler documentHandler) Allow an application to register a document event handler.voidsetDTDHandler(DTDHandler dtdHandler) Allow an application to register a DTD event handler.voidsetEntityResolver(EntityResolver resolver) Sets the resolver used to resolve external entities.voidsetErrorHandler(ErrorHandler errorHandler) Allow an application to register an error event handler.voidsetFeature(String featureId, boolean state) Set the state of any feature in a SAX2 parser.protected voidsetLexicalHandler(LexicalHandler handler) Set the lexical event handler.voidSet the locale to use for messages.voidsetProperty(String propertyId, Object value) Set the value of any property in a SAX2 parser.voidstartCDATA(org.apache.xerces.xni.Augmentations augs) The start of a CDATA section.voidstartDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs) The start of the document.voidstartElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) The start of an element.voidstartExternalSubset(org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) The start of the DTD external subset.voidstartGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs) This method notifies of the start of an entity.protected final voidSend startPrefixMapping eventsvoidstartParameterEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs) This method notifies of the start of parameter entity.voidunparsedEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String notation, org.apache.xerces.xni.Augmentations augs) An unparsed entity declaration.voidxmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs) Notifies of the presence of an XMLDecl line in the document.Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, emptyElement, endAttlist, endConditional, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, ignoredCharacters, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startAttlist, startConditional, startContentModel, startDTD, startGroup, textDecl
-
Field Details
-
NAMESPACES
Feature identifier: namespaces.- See Also:
-
STRING_INTERNING
Feature id: string interning.- See Also:
-
ALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order.- See Also:
-
LEXICAL_HANDLER
Property id: lexical handler.- See Also:
-
DECLARATION_HANDLER
Property id: declaration handler.- See Also:
-
DOM_NODE
Property id: DOM node.- See Also:
-
fNamespaces
protected boolean fNamespacesNamespaces. -
fNamespacePrefixes
protected boolean fNamespacePrefixesNamespace prefixes. -
fLexicalHandlerParameterEntities
protected boolean fLexicalHandlerParameterEntitiesLexical handler parameter entities. -
fStandalone
protected boolean fStandaloneStandalone document declaration. -
fResolveDTDURIs
protected boolean fResolveDTDURIsResolve DTD URIs. -
fUseEntityResolver2
protected boolean fUseEntityResolver2Use EntityResolver2. -
fXMLNSURIs
protected boolean fXMLNSURIsXMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace. -
fContentHandler
Content handler. -
fDocumentHandler
Document handler. -
fNamespaceContext
protected org.apache.xerces.xni.NamespaceContext fNamespaceContextNamespace context -
fDTDHandler
DTD handler. -
fDeclHandler
Decl handler. -
fLexicalHandler
Lexical handler. -
fQName
protected final org.apache.xerces.xni.QName fQName -
fParseInProgress
protected boolean fParseInProgressTrue if a parse is in progress. This state is needed because some features/properties cannot be set while parsing (e.g. validation and namespaces). -
fVersion
-
fDeclaredAttrs
-
-
Constructor Details
-
AbstractSAXParser
protected AbstractSAXParser(org.apache.xerces.xni.parser.XMLParserConfiguration config) Default constructor.
-
-
Method Details
-
startDocument
public void startDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The start of the document.- Specified by:
startDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startDocumentin classAbstractXMLDocumentParser- Parameters:
locator- The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document.encoding- The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).namespaceContext- The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
xmlDecl
public void xmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.- Specified by:
xmlDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
xmlDeclin classAbstractXMLDocumentParser- Parameters:
version- The XML version.encoding- The IANA encoding name of the document, or null if not specified.standalone- The standalone value, or null if not specified.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
doctypeDecl
public void doctypeDecl(String rootElement, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Notifies of the presence of the DOCTYPE line in the document.- Specified by:
doctypeDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
doctypeDeclin classAbstractXMLDocumentParser- Parameters:
rootElement- The name of the root element.publicId- The public identifier if an external DTD or null if the external DTD is specified using SYSTEM.systemId- The system identifier if an external DTD, null otherwise.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
startGeneralEntity
public void startGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.
- Specified by:
startGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startGeneralEntityin classAbstractXMLDocumentParser- Parameters:
name- The name of the entity.identifier- The resource identifier.encoding- The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endGeneralEntity
public void endGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.
- Specified by:
endGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
endGeneralEntityin classAbstractXMLDocumentParser- Parameters:
name- The name of the entity.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
startElement
public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.- Specified by:
startElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startElementin classAbstractXMLDocumentParser- Parameters:
element- The name of the element.attributes- The element attributes.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
characters
public void characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Character content.- Specified by:
charactersin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
charactersin classAbstractXMLDocumentParser- Parameters:
text- The content.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
ignorableWhitespace
public void ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.- Specified by:
ignorableWhitespacein interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
ignorableWhitespacein classAbstractXMLDocumentParser- Parameters:
text- The ignorable whitespace.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endElement
public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The end of an element.- Specified by:
endElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
endElementin classAbstractXMLDocumentParser- Parameters:
element- The name of the element.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
startCDATA
public void startCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The start of a CDATA section.- Specified by:
startCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startCDATAin classAbstractXMLDocumentParser- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endCDATA
public void endCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The end of a CDATA section.- Specified by:
endCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
endCDATAin classAbstractXMLDocumentParser- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
comment
public void comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException A comment.- Specified by:
commentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Specified by:
commentin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
commentin classAbstractXMLDocumentParser- Parameters:
text- The text in the comment.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by application to signal an error.
-
processingInstruction
public void processingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.
- Specified by:
processingInstructionin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Specified by:
processingInstructionin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
processingInstructionin classAbstractXMLDocumentParser- Parameters:
target- The target.data- The data or null if none specified.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endDocument
public void endDocument(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The end of the document.- Specified by:
endDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
endDocumentin classAbstractXMLDocumentParser- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
startExternalSubset
public void startExternalSubset(org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The start of the DTD external subset.- Specified by:
startExternalSubsetin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
startExternalSubsetin classAbstractXMLDocumentParser- Parameters:
identifier- The resource identifier.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endExternalSubset
public void endExternalSubset(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The end of the DTD external subset.- Specified by:
endExternalSubsetin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
endExternalSubsetin classAbstractXMLDocumentParser- Parameters:
augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
startParameterEntity
public void startParameterEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.
- Specified by:
startParameterEntityin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
startParameterEntityin classAbstractXMLDocumentParser- Parameters:
name- The name of the parameter entity.identifier- The resource identifier.encoding- The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endParameterEntity
public void endParameterEntity(String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.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.
- Specified by:
endParameterEntityin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
endParameterEntityin classAbstractXMLDocumentParser- Parameters:
name- The name of the parameter entity.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
elementDecl
public void elementDecl(String name, String contentModel, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException An element declaration.- Specified by:
elementDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
elementDeclin classAbstractXMLDocumentParser- Parameters:
name- The name of the element.contentModel- The element content model.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
attributeDecl
public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException An attribute declaration.- Specified by:
attributeDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
attributeDeclin classAbstractXMLDocumentParser- Parameters:
elementName- The name of the element that this attribute is associated with.attributeName- The name of the attribute.type- The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".enumeration- If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.defaultType- The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.defaultValue- The attribute default value, or null if no default value is specified.nonNormalizedDefaultValue- The attribute default value with no normalization performed, or null if no default value is specified.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
internalEntityDecl
public void internalEntityDecl(String name, org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.XMLString nonNormalizedText, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException An internal entity declaration.- Specified by:
internalEntityDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
internalEntityDeclin classAbstractXMLDocumentParser- Parameters:
name- The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.text- The value of the entity.nonNormalizedText- The non-normalized value of the entity. This value contains the same sequence of characters that was in the internal entity declaration, without any entity references expanded.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
externalEntityDecl
public void externalEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException An external entity declaration.- Specified by:
externalEntityDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
externalEntityDeclin classAbstractXMLDocumentParser- Parameters:
name- The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.identifier- An object containing all location information pertinent to this entity.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String notation, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException An unparsed entity declaration.- Specified by:
unparsedEntityDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
unparsedEntityDeclin classAbstractXMLDocumentParser- Parameters:
name- The name of the entity.identifier- An object containing all location information pertinent to this entity.notation- The name of the notation.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
notationDecl
public void notationDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException A notation declaration- Specified by:
notationDeclin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
notationDeclin classAbstractXMLDocumentParser- Parameters:
name- The name of the notation.identifier- An object containing all location information pertinent to this notation.augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
endDTD
public void endDTD(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException The end of the DTD.- Specified by:
endDTDin interfaceorg.apache.xerces.xni.XMLDTDHandler- Overrides:
endDTDin classAbstractXMLDocumentParser- Parameters:
augs- Additional information that may include infoset augmentations.- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
parse
Parses the input source specified by the given system identifier.This method is equivalent to the following:
parse(new InputSource(systemId));- Specified by:
parsein interfaceParser- Specified by:
parsein interfaceXMLReader- Parameters:
systemId- The system identifier (URI).- Throws:
SAXException- Throws exception on SAX error.IOException- Throws exception on i/o error.
-
parse
parse- Specified by:
parsein interfaceParser- Specified by:
parsein interfaceXMLReader- Parameters:
inputSource-- Throws:
SAXExceptionIOException
-
setEntityResolver
Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.- Specified by:
setEntityResolverin interfaceParser- Specified by:
setEntityResolverin interfaceXMLReader- Parameters:
resolver- The new entity resolver. Passing a null value will uninstall the currently installed resolver.
-
getEntityResolver
Return the current entity resolver.- Specified by:
getEntityResolverin interfaceXMLReader- Returns:
- The current entity resolver, or null if none has been registered.
- See Also:
-
setErrorHandler
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.
- Specified by:
setErrorHandlerin interfaceParser- Specified by:
setErrorHandlerin interfaceXMLReader- Parameters:
errorHandler- The error handler.- See Also:
-
getErrorHandler
Return the current error handler.- Specified by:
getErrorHandlerin interfaceXMLReader- Returns:
- The current error handler, or null if none has been registered.
- See Also:
-
setLocale
Set the locale to use for messages.- Specified by:
setLocalein interfaceParser- Parameters:
locale- The locale object to use for localization of messages.- Throws:
SAXException- An exception thrown if the parser does not support the specified locale.- See Also:
-
setDTDHandler
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.
- Specified by:
setDTDHandlerin interfaceParser- Specified by:
setDTDHandlerin interfaceXMLReader- Parameters:
dtdHandler- The DTD handler.- See Also:
-
setDocumentHandler
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.
- Specified by:
setDocumentHandlerin interfaceParser- Parameters:
documentHandler- The document handler.
-
setContentHandler
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.
- Specified by:
setContentHandlerin interfaceXMLReader- Parameters:
contentHandler- The content handler.- See Also:
-
getContentHandler
Return the current content handler.- Specified by:
getContentHandlerin interfaceXMLReader- Returns:
- The current content handler, or null if none has been registered.
- See Also:
-
getDTDHandler
Return the current DTD handler.- Specified by:
getDTDHandlerin interfaceXMLReader- Returns:
- The current DTD handler, or null if none has been registered.
- See Also:
-
setFeature
public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException 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.- Specified by:
setFeaturein interfaceXMLReader- Parameters:
featureId- The unique identifier (URI) of the feature.state- The requested state of the feature (true or false).- Throws:
SAXNotRecognizedException- If the requested feature is not known.SAXNotSupportedException- If the requested feature is known, but the requested state is not supported.
-
getFeature
public boolean getFeature(String featureId) throws SAXNotRecognizedException, SAXNotSupportedException Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.- Specified by:
getFeaturein interfaceXMLReader- Parameters:
featureId- The unique identifier (URI) of the feature being set.- Returns:
- The current state of the feature.
- Throws:
SAXNotRecognizedException- If the requested feature is not known.SAXNotSupportedException- If the requested feature is known but not supported.
-
setProperty
public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException 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.- Specified by:
setPropertyin interfaceXMLReader- Parameters:
propertyId- The unique identifier (URI) of the property being set.value- The value to which the property is being set.- Throws:
SAXNotRecognizedException- If the requested property is not known.SAXNotSupportedException- If the requested property is known, but the requested value is not supported.
-
getProperty
public Object getProperty(String propertyId) throws SAXNotRecognizedException, SAXNotSupportedException Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.- Specified by:
getPropertyin interfaceXMLReader- Parameters:
propertyId- The unique identifier (URI) of the property being set.- Returns:
- The current value of the property.
- Throws:
SAXNotRecognizedException- If the requested property is not known.SAXNotSupportedException- If the requested property is known but not supported.
-
setDeclHandler
protected void setDeclHandler(DeclHandler handler) throws SAXNotRecognizedException, SAXNotSupportedException Set the DTD declaration event handler.This method is the equivalent to the property:
http://xml.org/sax/properties/declaration-handler
- Parameters:
handler- The new handler.- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException- See Also:
-
getDeclHandler
Returns the DTD declaration event handler.- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException- See Also:
-
setLexicalHandler
protected void setLexicalHandler(LexicalHandler handler) throws SAXNotRecognizedException, SAXNotSupportedException Set the lexical event handler.This method is the equivalent to the property:
http://xml.org/sax/properties/lexical-handler
- Parameters:
handler- lexical event handler- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException- See Also:
-
getLexicalHandler
protected LexicalHandler getLexicalHandler() throws SAXNotRecognizedException, SAXNotSupportedExceptionReturns the lexical handler.- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException- See Also:
-
startNamespaceMapping
Send startPrefixMapping events- Throws:
SAXException
-
endNamespaceMapping
Send endPrefixMapping events- Throws:
SAXException
-
reset
public void reset() throws org.apache.xerces.xni.XNIExceptionReset all components before parsing.- Overrides:
resetin classAbstractXMLDocumentParser- Throws:
org.apache.xerces.xni.XNIException- Thrown if an error occurs during initialization.
-
getElementPSVI
public org.apache.xerces.xs.ElementPSVI getElementPSVI()Description copied from interface:org.apache.xerces.xs.PSVIProviderProvides the post schema validation item for the current element information item. The method must be called by an application while in the scope of the methods which report the start and end of an element. For example, for SAX the method must be called within the scope of the document handler'sstartElementorendElementcall. If the method is called outside of the specified scope, the return value is undefined.- Specified by:
getElementPSVIin interfaceorg.apache.xerces.xs.PSVIProvider- Returns:
- The post schema validation infoset for the current element. If an element information item is valid, then in the post-schema-validation infoset the following properties must be available for the element information item: The following properties are available in the scope of the method that reports the start of an element: {element declaration}, {validation context}, {notation}. The {schema information} property is available for the validation root. The {error codes} property is available if any errors occured during validation. The following properties are available in the scope of the method that reports the end of an element: {nil}, {schema specified}, {normalized value},{ member type definition}, {validity}, {validation attempted} . If the declaration has a value constraint, the property {schema default} is available. The {error codes} property is available if any errors occured during validation. Note: some processors may choose to provide all the PSVI properties in the scope of the method that reports the end of an element.
-
getAttributePSVI
public org.apache.xerces.xs.AttributePSVI getAttributePSVI(int index) Description copied from interface:org.apache.xerces.xs.PSVIProviderProvidesAttributePSVIgiven the index of an attribute information item in the current element's attribute list. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler'sstartElementcall. If the method is called outside of the specified scope, the return value is undefined.- Specified by:
getAttributePSVIin interfaceorg.apache.xerces.xs.PSVIProvider- Parameters:
index- The attribute index.- Returns:
- The post schema validation properties of the attribute.
-
getAttributePSVIByName
Description copied from interface:org.apache.xerces.xs.PSVIProviderProvidesAttributePSVIgiven the namespace name and the local name of an attribute information item in the current element's attribute list. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler'sstartElementcall. If the method is called outside of the specified scope, the return value is undefined.- Specified by:
getAttributePSVIByNamein interfaceorg.apache.xerces.xs.PSVIProvider- Parameters:
uri- The namespace name of an attribute.localname- The local name of an attribute.- Returns:
- The post schema validation properties of the attribute.
-