org.apache.xerces.impl.xs.opti

Class SchemaDOMParser

Implemented Interfaces:
org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler

public class SchemaDOMParser
extends DefaultXMLDocumentHandler

Version:
$Id: SchemaDOMParser.java 381533 2006-02-28 01:36:10Z mrglavas $
Authors:
Rahul Srivastava, Sun Microsystems Inc.
Sandy Gao, IBM

Field Summary

static String
ERROR_REPORTER
Property identifier: error reporter.
static String
GENERATE_SYNTHETIC_ANNOTATION
Feature identifier: generate synthetic annotations.
protected org.apache.xerces.xni.XMLLocator
fLocator
protected org.apache.xerces.xni.NamespaceContext
fNamespaceContext

Fields inherited from interface 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.apache.xerces.xni.XMLDTDHandler

CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE

Constructor Summary

SchemaDOMParser(org.apache.xerces.xni.parser.XMLParserConfiguration config)
Default constructor.

Method Summary

void
characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
Character content.
void
comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
A comment.
void
emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
An empty element.
void
endCDATA(org.apache.xerces.xni.Augmentations augs)
The end of a CDATA section.
void
endDocument(org.apache.xerces.xni.Augmentations augs)
The end of the document.
void
endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)
The end of an element.
org.w3c.dom.Document
getDocument()
Returns the DOM document object.
org.w3c.dom.Document
getDocument2()
Gets the document from SchemaParsingConfig
boolean
getFeature(String featureId)
Delegates to SchemaParsingConfig.getFeature
Object
getProperty(String propertyId)
Delegates to SchemaParsingConfig.getProperty.
void
ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
Ignorable whitespace.
void
parse(org.apache.xerces.xni.parser.XMLInputSource inputSource)
Delegates parsing to SchemaParsingConfig
void
processingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs)
A processing instruction.
void
reset()
Reset SchemaParsingConfig
void
resetNodePool()
ResetNodePool on SchemaParsingConfig
void
setEntityResolver(org.apache.xerces.xni.parser.XMLEntityResolver er)
Delegates to SchemaParsingConfig.setEntityResolver.
void
setFeature(String featureId, boolean state)
Delegates to SchemaParsingConfig.setFeature
void
setProperty(String propertyId, Object value)
Delegates to SchemaParsingConfig.setProperty.
void
startCDATA(org.apache.xerces.xni.Augmentations augs)
The start of a CDATA section.
void
startDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs)
void
startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
The start of an element.

Methods inherited from class org.apache.xerces.impl.xs.opti.DefaultXMLDocumentHandler

any, attributeDecl, characters, comment, doctypeDecl, element, elementDecl, empty, emptyElement, endAttlist, endCDATA, endConditional, endContentModel, endDTD, endDocument, endElement, endExternalSubset, endGeneralEntity, endGroup, endParameterEntity, endPrefixMapping, externalEntityDecl, getDTDContentModelSource, getDTDSource, getDocumentSource, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, occurrence, pcdata, processingInstruction, separator, setDTDContentModelSource, setDTDSource, setDocumentSource, startAttlist, startCDATA, startConditional, startContentModel, startDTD, startDocument, startElement, startExternalSubset, startGeneralEntity, startGroup, startParameterEntity, startPrefixMapping, textDecl, unparsedEntityDecl, xmlDecl

Field Details

ERROR_REPORTER

public static final String ERROR_REPORTER
Property identifier: error reporter.

GENERATE_SYNTHETIC_ANNOTATION

public static final String GENERATE_SYNTHETIC_ANNOTATION
Feature identifier: generate synthetic annotations.

fLocator

protected org.apache.xerces.xni.XMLLocator fLocator

fNamespaceContext

protected org.apache.xerces.xni.NamespaceContext fNamespaceContext

Constructor Details

SchemaDOMParser

public SchemaDOMParser(org.apache.xerces.xni.parser.XMLParserConfiguration config)
Default constructor.

Method Details

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:
characters in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
characters in interface DefaultXMLDocumentHandler
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.

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:
comment in interface org.apache.xerces.xni.XMLDocumentHandler
comment in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
comment in interface DefaultXMLDocumentHandler
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.

emptyElement

public void emptyElement(org.apache.xerces.xni.QName element,
                         org.apache.xerces.xni.XMLAttributes attributes,
                         org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An empty element.
Specified by:
emptyElement in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
emptyElement in interface DefaultXMLDocumentHandler
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.

endCDATA

public void endCDATA(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of a CDATA section.
Specified by:
endCDATA in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endCDATA in interface DefaultXMLDocumentHandler
Parameters:
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:
endDocument in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endDocument in interface DefaultXMLDocumentHandler
Parameters:
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:
endElement in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endElement in interface DefaultXMLDocumentHandler
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.

getDocument

public org.w3c.dom.Document getDocument()
Returns the DOM document object.

getDocument2

public org.w3c.dom.Document getDocument2()
Gets the document from SchemaParsingConfig
Returns:
Document

getFeature

public boolean getFeature(String featureId)
Delegates to SchemaParsingConfig.getFeature
Parameters:
featureId -
Returns:
boolean

getProperty

public Object getProperty(String propertyId)
Delegates to SchemaParsingConfig.getProperty.
Parameters:
propertyId -
Returns:
Object

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:
ignorableWhitespace in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
ignorableWhitespace in interface DefaultXMLDocumentHandler
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.

parse

public void parse(org.apache.xerces.xni.parser.XMLInputSource inputSource)
            throws IOException
Delegates parsing to SchemaParsingConfig
Parameters:
inputSource -

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:
processingInstruction in interface org.apache.xerces.xni.XMLDocumentHandler
processingInstruction in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
processingInstruction in interface DefaultXMLDocumentHandler
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.

reset

public void reset()
Reset SchemaParsingConfig

resetNodePool

public void resetNodePool()
ResetNodePool on SchemaParsingConfig

setEntityResolver

public void setEntityResolver(org.apache.xerces.xni.parser.XMLEntityResolver er)
Delegates to SchemaParsingConfig.setEntityResolver.
Parameters:
er - XMLEntityResolver

setFeature

public void setFeature(String featureId,
                       boolean state)
Delegates to SchemaParsingConfig.setFeature
Parameters:
featureId -
state -

setProperty

public void setProperty(String propertyId,
                        Object value)
Delegates to SchemaParsingConfig.setProperty.
Parameters:
propertyId -
value -

startCDATA

public void startCDATA(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The start of a CDATA section.
Specified by:
startCDATA in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startCDATA in interface DefaultXMLDocumentHandler
Parameters:
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

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
Specified by:
startDocument in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startDocument in interface DefaultXMLDocumentHandler

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.
Specified by:
startElement in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startElement in interface DefaultXMLDocumentHandler
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.

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.