|
Xerces 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.framework.XMLParser | +--org.apache.xerces.parsers.DOMParser
DOMParser provides a parser which produces a W3C DOM tree as its output
Nested Class Summary |
Nested classes inherited from class org.apache.xerces.framework.XMLDocumentHandler |
XMLDocumentHandler.DTDHandler |
Field Summary | |
static java.lang.String |
DEFAULT_DEFERRED_DOCUMENT_CLASS_NAME
Default deferred document class name (org.apache.xerces.dom.DeferredDocumentImpl). |
static java.lang.String |
DEFAULT_DOCUMENT_CLASS_NAME
Default programmatic document class name (org.apache.xerces.dom.DocumentImpl). |
protected int |
fAmpIndex
|
protected int |
fAposIndex
|
protected Node |
fCurrentElementNode
|
protected int |
fCurrentEntityName
|
protected int |
fCurrentEntityNode
|
protected int |
fCurrentNodeIndex
|
protected DeferredDocumentImpl |
fDeferredDocumentImpl
|
protected Document |
fDocument
|
protected DocumentImpl |
fDocumentImpl
|
protected int |
fDocumentIndex
|
protected DocumentType |
fDocumentType
|
protected int |
fDocumentTypeIndex
|
protected int |
fGtIndex
|
protected boolean |
fInCDATA
|
protected boolean |
fInDTD
|
protected int |
fLtIndex
|
protected int |
fQuotIndex
|
protected boolean |
fWithinElement
|
Fields inherited from class org.apache.xerces.framework.XMLParser |
fEntityHandler, fErrorReporter, fGrammarResolver, fParseInProgress, fScanner, fStringPool, fValidator, SAX2_FEATURES_PREFIX, SAX2_PROPERTIES_PREFIX, XERCES_FEATURES_PREFIX, XERCES_PROPERTIES_PREFIX |
Fields inherited from interface org.apache.xerces.framework.XMLErrorReporter |
ERRORTYPE_FATAL_ERROR, ERRORTYPE_RECOVERABLE_ERROR, ERRORTYPE_WARNING |
Constructor Summary | |
DOMParser()
Default constructor. |
Method Summary | |
void |
attlistDecl(org.apache.xerces.utils.QName elementDecl,
org.apache.xerces.utils.QName attributeDecl,
int attType,
boolean attList,
java.lang.String enumString,
int attDefaultType,
int attDefaultValue)
<! |
void |
characters(char[] ch,
int start,
int length)
Not called. |
void |
characters(int dataIndex)
Characters. |
void |
comment(int dataIndex)
Comment. |
void |
elementDecl(org.apache.xerces.utils.QName elementDecl,
int contentSpecType,
int contentSpecIndex,
XMLContentSpec.Provider contentSpecProvider)
<! |
void |
endCDATA()
End CDATA section. |
void |
endDocument()
End document. |
void |
endDTD()
This function will be called at the end of the DTD. |
void |
endElement(org.apache.xerces.utils.QName elementQName)
End element. |
void |
endEntityReference(int entityName,
int entityType,
int entityContext)
End entity reference. |
void |
endNamespaceDeclScope(int prefix)
Report the end of the scope of a namespace declaration. |
void |
externalEntityDecl(int entityNameIndex,
int publicIdIndex,
int systemIdIndex)
<! |
void |
externalPEDecl(int entityNameIndex,
int publicIdIndex,
int systemIdIndex)
<! |
boolean |
getCreateEntityReferenceNodes()
Returns true if entity references within the document are included in the document tree as EntityReference nodes. |
protected Element |
getCurrentElementNode()
Returns the current element node. |
protected boolean |
getDeferNodeExpansion()
Returns true if the expansion of the nodes in the default DOM implementation are deferred. |
Document |
getDocument()
Returns the document. |
protected java.lang.String |
getDocumentClassName()
Returns the fully qualified class name of the document factory used when constructing the DOM tree. |
boolean |
getFeature(java.lang.String featureId)
Query the current state of any feature in a SAX2 parser. |
java.lang.String[] |
getFeaturesRecognized()
Returns a list of features that this parser recognizes. |
boolean |
getIncludeIgnorableWhitespace()
Returns true if ignorable whitespace text nodes are included in the DOM tree. |
java.lang.String[] |
getPropertiesRecognized()
Returns a list of properties that this parser recognizes. |
java.lang.Object |
getProperty(java.lang.String propertyId)
Return the current value of a property in a SAX2 parser. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Not called. |
void |
ignorableWhitespace(int dataIndex)
Ignorable whitespace. |
protected void |
init()
Initializes the parser to a pre-parse state. |
void |
internalEntityDecl(int entityNameIndex,
int entityValueIndex)
<! |
void |
internalPEDecl(int entityNameIndex,
int entityValueIndex)
<! |
void |
internalSubset(int internalSubset)
Supports DOM Level 2 internalSubset additions. |
void |
notationDecl(int notationNameIndex,
int publicIdIndex,
int systemIdIndex)
<! |
void |
processingInstruction(int targetIndex,
int dataIndex)
Processing instruction. |
void |
reset()
Resets the parser. |
void |
resetOrCopy()
Resets or copies the parser. |
protected void |
setCreateEntityReferenceNodes(boolean create)
This feature determines whether entity references within the document are included in the document tree as EntityReference nodes. |
protected void |
setDeferNodeExpansion(boolean deferNodeExpansion)
This method sets whether the expansion of the nodes in the default DOM implementation are deferred. |
protected void |
setDocumentClassName(java.lang.String documentClassName)
This method allows the programmer to decide which document factory to use when constructing the DOM tree. |
void |
setFeature(java.lang.String featureId,
boolean state)
Set the state of any feature in a SAX2 parser. |
void |
setIncludeIgnorableWhitespace(boolean include)
This feature determines whether text nodes that can be considered "ignorable whitespace" are included in the DOM tree. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Set the value of any property in a SAX2 parser. |
void |
startCDATA()
Start CDATA section. |
void |
startDocument()
Start document. |
void |
startDTD(org.apache.xerces.utils.QName rootElement,
int publicId,
int systemId)
This function will be called when a <! |
void |
startElement(org.apache.xerces.utils.QName elementQName,
XMLAttrList xmlAttrList,
int attrListIndex)
Start element. |
void |
startEntityReference(int entityName,
int entityType,
int entityContext)
Start entity reference. |
void |
startNamespaceDeclScope(int prefix,
int uri)
Report the start of the scope of a namespace declaration. |
void |
textDecl(int versionIndex,
int encodingIndex)
Text declaration. |
void |
unparsedEntityDecl(int entityNameIndex,
int publicIdIndex,
int systemIdIndex,
int notationNameIndex)
<! |
void |
xmlDecl(int versionIndex,
int encodingIndex,
int standaloneIndex)
XML declaration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_DOCUMENT_CLASS_NAME
public static final java.lang.String DEFAULT_DEFERRED_DOCUMENT_CLASS_NAME
protected Document fDocument
protected DeferredDocumentImpl fDeferredDocumentImpl
protected int fDocumentIndex
protected int fDocumentTypeIndex
protected int fCurrentNodeIndex
protected int fCurrentEntityName
protected int fCurrentEntityNode
protected DocumentImpl fDocumentImpl
protected DocumentType fDocumentType
protected Node fCurrentElementNode
protected boolean fInDTD
protected boolean fWithinElement
protected boolean fInCDATA
protected int fAmpIndex
protected int fLtIndex
protected int fGtIndex
protected int fAposIndex
protected int fQuotIndex
Constructor Detail |
public DOMParser()
Method Detail |
public Document getDocument()
public java.lang.String[] getFeaturesRecognized()
getFeaturesRecognized
in class XMLParser
XMLParser.isFeatureRecognized(java.lang.String)
,
setFeature(java.lang.String, boolean)
,
getFeature(java.lang.String)
public java.lang.String[] getPropertiesRecognized()
getPropertiesRecognized
in class XMLParser
XMLParser.isPropertyRecognized(java.lang.String)
,
setProperty(java.lang.String, java.lang.Object)
,
getProperty(java.lang.String)
public void reset() throws java.lang.Exception
reset
in class XMLParser
java.lang.Exception
public void resetOrCopy() throws java.lang.Exception
resetOrCopy
in class XMLParser
java.lang.Exception
protected void init()
parse()
.
protected void setDeferNodeExpansion(boolean deferNodeExpansion) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
getDeferNodeExpansion()
,
setDocumentClassName(java.lang.String)
protected boolean getDeferNodeExpansion() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setDeferNodeExpansion(boolean)
protected void setCreateEntityReferenceNodes(boolean create) throws SAXNotRecognizedException, SAXNotSupportedException
Note: The children of the entity reference are always added to the document. This feature only affects whether an EntityReference node is also included as the parent of the entity reference children.
create
- True to create entity reference nodes; false
to only insert the entity reference children.
SAXNotRecognizedException
SAXNotSupportedException
getCreateEntityReferenceNodes()
public boolean getCreateEntityReferenceNodes() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setCreateEntityReferenceNodes(boolean)
public void setIncludeIgnorableWhitespace(boolean include) throws SAXNotRecognizedException, SAXNotSupportedException
Note: The only way that the parser can determine if text is ignorable is by reading the associated grammar and having a content model for the document. When ignorable whitespace text nodes *are* included in the DOM tree, they will be flagged as ignorable. The ignorable flag can be queried by calling the TextImpl#isIgnorableWhitespace():boolean method.
include
- True to include ignorable whitespace text nodes;
false to not include ignorable whitespace text
nodes.
SAXNotRecognizedException
SAXNotSupportedException
getIncludeIgnorableWhitespace()
public boolean getIncludeIgnorableWhitespace() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setIncludeIgnorableWhitespace(boolean)
protected void setDocumentClassName(java.lang.String documentClassName) throws SAXNotRecognizedException, SAXNotSupportedException
documentClassName
- The fully qualified class name of the
document factory to use when constructing
the DOM tree.
SAXNotRecognizedException
SAXNotSupportedException
getDocumentClassName()
,
setDeferNodeExpansion(boolean)
,
DEFAULT_DOCUMENT_CLASS_NAME
protected java.lang.String getDocumentClassName() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setDocumentClassName(java.lang.String)
protected Element getCurrentElementNode() throws SAXNotRecognizedException, SAXNotSupportedException
Note: This method is not supported when the "deferNodeExpansion" property is set to true and the document factory is set to the default factory.
SAXNotRecognizedException
SAXNotSupportedException
public void setFeature(java.lang.String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in class XMLParser
featureId
- The unique identifier (URI) of the feature.state
- The requested state of the feature (true or false).
SAXNotRecognizedException
- If the requested feature is
not known.
SAXNotSupportedException
- If the requested feature is
known, but the requested state
is not supported.
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
- If the
requested feature is known, but the requested
state is not supported.public boolean getFeature(java.lang.String featureId) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature
in class XMLParser
featureId
- The unique identifier (URI) of the feature
being set.
SAXNotRecognizedException
- If the requested feature is
not known.
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
public void setProperty(java.lang.String propertyId, java.lang.Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in class XMLParser
propertyId
- The unique identifier (URI) of the property
being set.
SAXNotRecognizedException
- If the requested property is
not known.
SAXNotSupportedException
- If the requested property is
known, but the requested
value is not supported.
SAXNotSupportedException
- If the
requested property is known, but the requested
value is not supported.
SAXNotRecognizedException
- If the
requested property is not known.public java.lang.Object getProperty(java.lang.String propertyId) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in class XMLParser
propertyId
- The unique identifier (URI) of the property
being set.
SAXNotRecognizedException
- If the requested property is
not known.
SAXNotRecognizedException
- If the
requested property is not known.
SAXNotSupportedException
Configurable#getProperty
public void startDocument()
startDocument
in interface XMLDocumentHandler
public void endDocument() throws java.lang.Exception
endDocument
in interface XMLDocumentHandler
java.lang.Exception
public void xmlDecl(int versionIndex, int encodingIndex, int standaloneIndex) throws java.lang.Exception
xmlDecl
in interface XMLDocumentHandler
versionIndex
- the handle in the string pool for the version numberencodingIndex
- the handle in the string pool for the encoding
java.lang.Exception
public void textDecl(int versionIndex, int encodingIndex) throws java.lang.Exception
textDecl
in interface XMLDocumentHandler
java.lang.Exception
public void startNamespaceDeclScope(int prefix, int uri) throws java.lang.Exception
startNamespaceDeclScope
in interface XMLDocumentHandler
prefix
- string pool index of the namespace prefix being declareduri
- string pool index of the namespace uri begin bound
java.lang.Exception
public void endNamespaceDeclScope(int prefix) throws java.lang.Exception
endNamespaceDeclScope
in interface XMLDocumentHandler
prefix
- string pool index of the namespace prefix being declared
java.lang.Exception
public void startElement(org.apache.xerces.utils.QName elementQName, XMLAttrList xmlAttrList, int attrListIndex) throws java.lang.Exception
startElement
in interface XMLDocumentHandler
xmlAttrList
- attrList containing the attributes of the elementattrListIndex
- handle into attrList. Allows attributes to be retreived.
java.lang.Exception
public void endElement(org.apache.xerces.utils.QName elementQName) throws java.lang.Exception
endElement
in interface XMLDocumentHandler
java.lang.Exception
public void characters(int dataIndex) throws java.lang.Exception
characters
in interface XMLDocumentHandler
dataIndex
- string pool index of the characters that were scanned
java.lang.Exception
public void ignorableWhitespace(int dataIndex) throws java.lang.Exception
ignorableWhitespace
in interface XMLDocumentHandler
dataIndex
- string pool index of ignorable whitespace
java.lang.Exception
public void processingInstruction(int targetIndex, int dataIndex) throws java.lang.Exception
processingInstruction
in interface XMLDocumentHandler
targetIndex
- string pool index of the PI targetdataIndex
- string pool index of the PI data
java.lang.Exception
public void comment(int dataIndex) throws java.lang.Exception
comment
in interface XMLDocumentHandler
dataIndex
- string pool index of the comment text
java.lang.Exception
public void characters(char[] ch, int start, int length) throws java.lang.Exception
characters
in interface XMLDocumentHandler
ch
- character array containing the characters that were scannedstart
- offset in ch where scanned characters beginlength
- length of scanned characters in ch
java.lang.Exception
public void ignorableWhitespace(char[] ch, int start, int length) throws java.lang.Exception
ignorableWhitespace
in interface XMLDocumentHandler
ch
- character array containing the whitespace that was scannedstart
- offset in ch where scanned whitespace beginslength
- length of scanned whitespace in ch
java.lang.Exception
public void startCDATA() throws java.lang.Exception
startCDATA
in interface XMLDocumentHandler
java.lang.Exception
public void endCDATA() throws java.lang.Exception
endCDATA
in interface XMLDocumentHandler
java.lang.Exception
public void startEntityReference(int entityName, int entityType, int entityContext) throws java.lang.Exception
startEntityReference
in interface XMLDocumentHandler
entityName
- string pool index of the entity nameentityType
- the XMLEntityHandler.ENTITYTYPE_* typeentityContext
- the XMLEntityHandler.ENTITYREF_* type for where
the entity reference appears
java.lang.Exception
XMLEntityHandler
,
XMLEntityHandler
public void endEntityReference(int entityName, int entityType, int entityContext) throws java.lang.Exception
endEntityReference
in interface XMLDocumentHandler
entityName
- string pool index of the entity anementityType
- the XMLEntityHandler.ENTITYTYPE_* typeentityContext
- the XMLEntityHandler.ENTITYREF_* type for where
the entity reference appears
java.lang.Exception
XMLEntityHandler
,
XMLEntityHandler
public void startDTD(org.apache.xerces.utils.QName rootElement, int publicId, int systemId) throws java.lang.Exception
startDTD
in interface XMLDocumentHandler.DTDHandler
publicId
- string pool index of the DTD's public IDsystemId
- string pool index of the DTD's system ID
java.lang.Exception
public void internalSubset(int internalSubset)
internalSubset
in interface XMLDocumentHandler.DTDHandler
public void endDTD() throws java.lang.Exception
endDTD
in interface XMLDocumentHandler.DTDHandler
java.lang.Exception
public void elementDecl(org.apache.xerces.utils.QName elementDecl, int contentSpecType, int contentSpecIndex, XMLContentSpec.Provider contentSpecProvider) throws java.lang.Exception
elementDecl
in interface XMLDocumentHandler.DTDHandler
java.lang.Exception
XMLContentSpec
public void attlistDecl(org.apache.xerces.utils.QName elementDecl, org.apache.xerces.utils.QName attributeDecl, int attType, boolean attList, java.lang.String enumString, int attDefaultType, int attDefaultValue) throws java.lang.Exception
attlistDecl
in interface XMLDocumentHandler.DTDHandler
attType
- type of attributeenumString
- String representing the values of the enumeration,
if the attribute is of enumerated type, or null if it is not.attDefaultType
- an integer value denoting the DefaultDecl valueattDefaultValue
- string pool index of this attribute's default value
or -1 if there is no defaultvalue
java.lang.Exception
public void internalPEDecl(int entityNameIndex, int entityValueIndex) throws java.lang.Exception
internalPEDecl
in interface XMLDocumentHandler.DTDHandler
entityNameIndex
- string pool index of the entity nameentityValueIndex
- string pool index of the entity replacement text
java.lang.Exception
public void externalPEDecl(int entityNameIndex, int publicIdIndex, int systemIdIndex) throws java.lang.Exception
externalPEDecl
in interface XMLDocumentHandler.DTDHandler
entityNameIndex
- string pool index of the entity namepublicIdIndex
- string pool index of the entity's public id.systemIdIndex
- string pool index of the entity's system id.
java.lang.Exception
public void internalEntityDecl(int entityNameIndex, int entityValueIndex) throws java.lang.Exception
internalEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityNameIndex
- string pool index of the entity nameentityValueIndex
- string pool index of the entity replacement text
java.lang.Exception
public void externalEntityDecl(int entityNameIndex, int publicIdIndex, int systemIdIndex) throws java.lang.Exception
externalEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityNameIndex
- string pool index of the entity namepublicIdIndex
- string pool index of the entity's public id.systemIdIndex
- string pool index of the entity's system id.
java.lang.Exception
public void unparsedEntityDecl(int entityNameIndex, int publicIdIndex, int systemIdIndex, int notationNameIndex) throws java.lang.Exception
unparsedEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityNameIndex
- string pool index of the entity namepublicIdIndex
- string pool index of the entity's public id.systemIdIndex
- string pool index of the entity's system id.notationNameIndex
- string pool index of the notation name.
java.lang.Exception
public void notationDecl(int notationNameIndex, int publicIdIndex, int systemIdIndex) throws java.lang.Exception
notationDecl
in interface XMLDocumentHandler.DTDHandler
notationNameIndex
- string pool index of the notation namepublicIdIndex
- string pool index of the notation's public id.systemIdIndex
- string pool index of the notation's system id.
java.lang.Exception
|
Xerces 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |