Class SchemaDOMParser
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.opti.DefaultXMLDocumentHandler
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.opti.SchemaDOMParser
-
- All Implemented Interfaces:
XMLDocumentHandler,XMLDTDContentModelHandler,XMLDTDHandler
public class SchemaDOMParser extends DefaultXMLDocumentHandler
- Version:
- $Id$
- Author:
- Rahul Srivastava, Sun Microsystems Inc., Sandy Gao, IBM
-
-
Field Summary
Fields Modifier and Type Field Description static StringERROR_REPORTERProperty identifier: error reporter.protected XMLLocatorfLocatorprotected NamespaceContextfNamespaceContextstatic StringGENERATE_SYNTHETIC_ANNOTATIONFeature identifier: generate synthetic annotations.-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
-
-
Constructor Summary
Constructors Constructor Description SchemaDOMParser(XMLParserConfiguration config)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(XMLString text, Augmentations augs)Character content.voidcomment(XMLString text, Augmentations augs)A comment.voidemptyElement(QName element, XMLAttributes attributes, Augmentations augs)An empty element.voidendCDATA(Augmentations augs)The end of a CDATA section.voidendDocument(Augmentations augs)The end of the document.voidendElement(QName element, Augmentations augs)The end of an element.DocumentgetDocument()Returns the DOM document object.booleangetFeature(String featureId)Delegates to SchemaParsingConfig.getFeatureObjectgetProperty(String propertyId)Delegates to SchemaParsingConfig.getProperty.voidignorableWhitespace(XMLString text, Augmentations augs)Ignorable whitespace.voidparse(XMLInputSource inputSource)Delegates parsing to SchemaParsingConfigvoidprocessingInstruction(String target, XMLString data, Augmentations augs)A processing instruction.voidreset()Reset SchemaParsingConfigvoidresetNodePool()ResetNodePool on SchemaParsingConfigvoidsetEntityResolver(XMLEntityResolver er)Delegates to SchemaParsingConfig.setEntityResolver.voidsetFeature(String featureId, boolean state)Delegates to SchemaParsingConfig.setFeaturevoidsetProperty(String propertyId, Object value)Delegates to SchemaParsingConfig.setProperty.voidstartCDATA(Augmentations augs)The start of a CDATA section.voidstartDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs)The start of the document.voidstartElement(QName element, XMLAttributes attributes, Augmentations augs)The start of an element.-
Methods inherited from class org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.opti.DefaultXMLDocumentHandler
any, attributeDecl, doctypeDecl, element, elementDecl, empty, endAttlist, endConditional, endContentModel, endDTD, endExternalSubset, endGeneralEntity, endGroup, endParameterEntity, endPrefixMapping, externalEntityDecl, getDocumentSource, getDTDContentModelSource, getDTDSource, ignoredCharacters, internalEntityDecl, notationDecl, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startAttlist, startConditional, startContentModel, startDTD, startExternalSubset, startGeneralEntity, startGroup, startParameterEntity, startPrefixMapping, textDecl, unparsedEntityDecl, xmlDecl
-
-
-
-
Field Detail
-
ERROR_REPORTER
public static final String ERROR_REPORTER
Property identifier: error reporter.- See Also:
- Constant Field Values
-
GENERATE_SYNTHETIC_ANNOTATION
public static final String GENERATE_SYNTHETIC_ANNOTATION
Feature identifier: generate synthetic annotations.- See Also:
- Constant Field Values
-
fLocator
protected XMLLocator fLocator
-
fNamespaceContext
protected NamespaceContext fNamespaceContext
-
-
Constructor Detail
-
SchemaDOMParser
public SchemaDOMParser(XMLParserConfiguration config)
Default constructor.
-
-
Method Detail
-
startDocument
public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException
Description copied from class:DefaultXMLDocumentHandlerThe start of the document.- Specified by:
startDocumentin interfaceXMLDocumentHandler- Overrides:
startDocumentin classDefaultXMLDocumentHandler- 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:
XNIException- Thrown by handler to signal an error.
-
endDocument
public void endDocument(Augmentations augs) throws XNIException
The end of the document.- Specified by:
endDocumentin interfaceXMLDocumentHandler- Overrides:
endDocumentin classDefaultXMLDocumentHandler- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
comment
public void comment(XMLString text, Augmentations augs) throws XNIException
A comment.- Specified by:
commentin interfaceXMLDocumentHandler- Specified by:
commentin interfaceXMLDTDHandler- Overrides:
commentin classDefaultXMLDocumentHandler- Parameters:
text- The text in the comment.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by application to signal an error.
-
processingInstruction
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.
- Specified by:
processingInstructionin interfaceXMLDocumentHandler- Specified by:
processingInstructionin interfaceXMLDTDHandler- Overrides:
processingInstructionin classDefaultXMLDocumentHandler- Parameters:
target- The target.data- The data or null if none specified.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
characters
public void characters(XMLString text, Augmentations augs) throws XNIException
Character content.- Specified by:
charactersin interfaceXMLDocumentHandler- Overrides:
charactersin classDefaultXMLDocumentHandler- Parameters:
text- The content.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
startElement
public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException
The start of an element.- Specified by:
startElementin interfaceXMLDocumentHandler- Overrides:
startElementin classDefaultXMLDocumentHandler- Parameters:
element- The name of the element.attributes- The element attributes.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
emptyElement
public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException
An empty element.- Specified by:
emptyElementin interfaceXMLDocumentHandler- Overrides:
emptyElementin classDefaultXMLDocumentHandler- Parameters:
element- The name of the element.attributes- The element attributes.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
endElement
public void endElement(QName element, Augmentations augs) throws XNIException
The end of an element.- Specified by:
endElementin interfaceXMLDocumentHandler- Overrides:
endElementin classDefaultXMLDocumentHandler- Parameters:
element- The name of the element.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
ignorableWhitespace
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.- Specified by:
ignorableWhitespacein interfaceXMLDocumentHandler- Overrides:
ignorableWhitespacein classDefaultXMLDocumentHandler- Parameters:
text- The ignorable whitespace.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
startCDATA
public void startCDATA(Augmentations augs) throws XNIException
The start of a CDATA section.- Specified by:
startCDATAin interfaceXMLDocumentHandler- Overrides:
startCDATAin classDefaultXMLDocumentHandler- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
endCDATA
public void endCDATA(Augmentations augs) throws XNIException
The end of a CDATA section.- Specified by:
endCDATAin interfaceXMLDocumentHandler- Overrides:
endCDATAin classDefaultXMLDocumentHandler- Parameters:
augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
getDocument
public Document getDocument()
Returns the DOM document object.
-
setFeature
public void setFeature(String featureId, boolean state)
Delegates to SchemaParsingConfig.setFeature- Parameters:
featureId-state-
-
getFeature
public boolean getFeature(String featureId)
Delegates to SchemaParsingConfig.getFeature- Parameters:
featureId-- Returns:
- boolean
-
setProperty
public void setProperty(String propertyId, Object value)
Delegates to SchemaParsingConfig.setProperty.- Parameters:
propertyId-value-
-
getProperty
public Object getProperty(String propertyId)
Delegates to SchemaParsingConfig.getProperty.- Parameters:
propertyId-- Returns:
- Object
-
setEntityResolver
public void setEntityResolver(XMLEntityResolver er)
Delegates to SchemaParsingConfig.setEntityResolver.- Parameters:
er- XMLEntityResolver
-
parse
public void parse(XMLInputSource inputSource) throws IOException
Delegates parsing to SchemaParsingConfig- Parameters:
inputSource-- Throws:
IOException
-
reset
public void reset()
Reset SchemaParsingConfig
-
resetNodePool
public void resetNodePool()
ResetNodePool on SchemaParsingConfig
-
-