|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.xml.sax.HandlerBase
oracle.xml.parser.v2.DefaultXMLDocumentHandler
oracle.xml.parser.v2.DocumentBuilder
This class implements XMLDocumentHandler (deprecated) and ContentHandler to build a DOM Tree from SAX 2.0 events. XMLDocumentHandler events are supported for backward compatibility
Field Summary | |
protected XMLNode |
root |
Constructor Summary | |
DocumentBuilder() Default Constructor. |
Method Summary | |
void |
attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value) Report an attribute type declaration. |
void |
cDATASection(char[] ch, int start, int length) Receive notification of CDATA Section data inside an element. |
void |
characters(char[] ch, int start, int length) Receive notification of character data inside an element. |
void |
comment(char[] ch, int start, int length) Report an XML comment anywhere in the document. |
void |
comment(java.lang.String data) Receive notification of a comment. |
void |
elementDecl(java.lang.String name, java.lang.String model) Report an element type declaration. |
void |
endCDATA() Report the end of a CDATA section. |
void |
endDoctype() Receive notification of end of the DTD. |
void |
endDocument() Receive notification of the end of the document. |
void |
endDTD() Report the end of DTD declarations. |
void |
endElement(NSName elem) Receive notification of the end of an element. |
void |
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) Receive notification of the end of an element. |
void |
endEntity(java.lang.String name) Report the end of an entity. |
void |
externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) Report a parsed external entity declaration. |
XMLDocument |
getDocument() Get the document being build |
Locator |
getLocator() Get the locator reported by the Reader using setDocumentLocator |
XMLNode |
getRoot() Get the root of tree being built |
void |
ignorableWhitespace(char[] ch, int start, int length) Receive notification of ignorable whitespace in element content. |
void |
internalEntityDecl(java.lang.String name, java.lang.String value) Report an internal entity declaration. |
void |
processingInstruction(java.lang.String target, java.lang.String data) Receive notification of a processing instruction. |
void |
reset() Resets the document builder state |
void |
resetNodeFactory() Reset the NodeFactory and go back to the original behaviour. |
void |
retainCDATASection(boolean flag) Sets a flag to retain CDATA sections |
void |
setAttribute(java.lang.String name, java.lang.Object value) Allows the user to set specific attributes on the underlying implementation. |
void |
setDebugMode(boolean flag) Sets a flag to turn on debug information in the document |
void |
setDoctype(DTD dtd) Receive notification of DTD Sets the DTD |
void |
setDocumentLocator(Locator locator) Receive a Locator object for document events. |
void |
setNodeFactory(NodeFactory f) Set a optional NodeFactory to be used for creating custom DOM trees |
void |
setNodeFactory(XMLDocument doc) Set document as the factory to create nodes |
void |
setTextDecl(java.lang.String version, java.lang.String encoding) Receive notification of a Text XML Declaration. |
void |
setXMLDecl(java.lang.String version, java.lang.String standalone, java.lang.String encoding) Receive notification of a XML Declaration. |
void |
startCDATA() Report the start of a CDATA section. |
void |
startDocument() Receive notification of the beginning of the document. |
void |
startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) Report the start of DTD declarations, if any. |
void |
startElement(NSName elem, SAXAttrList attrlist) Receive notification of the beginning of an element. |
void |
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) Receive notification of the beginning of an element. |
void |
startEntity(java.lang.String name) Report the beginning of some internal and external XML entities. |
Methods inherited from class oracle.xml.parser.v2.DefaultXMLDocumentHandler |
endPrefixMapping, getHandler, setError, setHandler, setXMLSchema, skippedEntity, startPrefixMapping |
Methods inherited from class org.xml.sax.HandlerBase |
endElement, error, fatalError, notationDecl, resolveEntity, startElement, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
endPrefixMapping, skippedEntity, startPrefixMapping |
Methods inherited from interface org.xml.sax.DocumentHandler |
endElement, startElement |
Field Detail |
protected XMLNode root
Constructor Detail |
public DocumentBuilder()
Method Detail |
public void reset()
public void startElement(NSName elem, SAXAttrList attrlist) throws SAXException
startElement
in interface XMLDocumentHandler
startElement
in class DefaultXMLDocumentHandler
elem
- NSName objectattrlist
- SAXAttrList for the elementSAXException
- A SAXException
could be thrown.DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultXMLDocumentHandler
namespaceURI
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified name (with prefix), or the empty string if qualified names are not available.atts
- The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.SAXException
- Any SAX exception, possibly wrapping another exception.endElement(oracle.xml.parser.v2.NSName)
, Attributes
public void endElement(NSName elem) throws SAXException
endElement
in interface XMLDocumentHandler
endElement
in class DefaultXMLDocumentHandler
elem
- NSName objectSAXException
- A SAXException
could be thrown.DocumentHandler.endElement(java.lang.String)
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultXMLDocumentHandler
namespaceURI
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName
- The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.SAXException
- Any SAX exception, possibly wrapping another exception.public void setDocumentLocator(Locator locator)
By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class HandlerBase
locator
- A locator for all SAX document events.DocumentHandler.setDocumentLocator(org.xml.sax.Locator)
, Locator
public Locator getLocator()
public XMLDocument getDocument()
public XMLNode getRoot()
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class HandlerBase
SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.startDocument()
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class HandlerBase
SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.endDocument()
public void setDoctype(DTD dtd) throws SAXException
setDoctype
in interface XMLDocumentHandler
setDoctype
in class DefaultXMLDocumentHandler
dtd
- set the DTD for the documentSAXException
- Any SAX exception, possibly wrapping another exception.public void endDoctype() throws SAXException
endDoctype
in interface XMLDocumentHandler
endDoctype
in class DefaultXMLDocumentHandler
SAXException
- Any SAX exception, possibly wrapping another exception.public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class HandlerBase
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the character array.SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.characters(char[], int, int)
public void cDATASection(char[] ch, int start, int length) throws SAXException
cDATASection
in interface XMLDocumentHandler
cDATASection
in class DefaultXMLDocumentHandler
ch
- The CDATA characters.start
- The start position in the character array.length
- The number of characters to use from the character array.SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.characters(char[], int, int)
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class HandlerBase
ch
- The whitespace characters.start
- The start position in the character array.length
- The number of characters to use from the character array.SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class HandlerBase
target
- The processing instruction target.data
- The processing instruction data, or null if none is supplied.SAXException
- Any SAX exception, possibly wrapping another exception.DocumentHandler.processingInstruction(java.lang.String, java.lang.String)
public void setXMLDecl(java.lang.String version, java.lang.String standalone, java.lang.String encoding) throws SAXException
The Parser will invoke this method once for XML Decl
setXMLDecl
in interface XMLDocumentHandler
setXMLDecl
in class DefaultXMLDocumentHandler
version
- The version numberstandalone
- The standalone value (or null, if not specifed)encoding
- The encoding name (or null, if not specifed)SAXException
- Any SAX exception, possibly wrapping another exception.public void setTextDecl(java.lang.String version, java.lang.String encoding) throws SAXException
The Parser will invoke this method once for each text XML Decl
setTextDecl
in interface XMLDocumentHandler
setTextDecl
in class DefaultXMLDocumentHandler
version
- The version number (or null, if not specified)encoding
- The encoding nameSAXException
- Any SAX exception, possibly wrapping another exception.public void comment(java.lang.String data) throws SAXException
comment
in interface XMLDocumentHandler
comment
in class DefaultXMLDocumentHandler
data
- The comment data, or null if none was supplied.SAXException
- Any SAX exception, possibly wrapping another exception.public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
startDTD
in interface LexicalHandler
name
- The document type name.publicId
- The declared public identifier for the external DTD subset, or null if none was declared.systemId
- The declared system identifier for the external DTD subset, or null if none was declared.SAXException
- The application may raise an exception.endDTD()
, startEntity(java.lang.String)
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
- The application may raise an exception.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void startEntity(java.lang.String name) throws SAXException
All start/endEntity events must be properly nested.
startEntity
in interface LexicalHandler
name
- The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".SAXException
- The application may raise an exception.endEntity(java.lang.String)
, DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
, DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void endEntity(java.lang.String name) throws SAXException
endEntity
in interface LexicalHandler
name
- The name of the entity that is ending.SAXException
- The application may raise an exception.startEntity(java.lang.String)
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
- The application may raise an exception.endCDATA()
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
- The application may raise an exception.startCDATA()
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
ch
- An array holding the characters in the comment.start
- The starting position in the array.length
- The number of characters to use from the array.SAXException
- The application may raise an exception.public void elementDecl(java.lang.String name, java.lang.String model) throws SAXException
elementDecl
in interface DeclHandler
name
- The element type name.model
- The content model as a normalized string.SAXException
- The application may raise an exception.public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value) throws SAXException
attributeDecl
in interface DeclHandler
eName
- The name of the associated element.aName
- The name of the attribute.type
- A string representing the attribute type.valueDefault
- A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.value
- A string representing the attribute's default value, or null if there is none.SAXException
- The application may raise an exception.public void internalEntityDecl(java.lang.String name, java.lang.String value) throws SAXException
internalEntityDecl
in interface DeclHandler
name
- The name of the entity. If it is a parameter entity, the name will begin with '%'.value
- The replacement text of the entity.SAXException
- The application may raise an exception.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
, DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
externalEntityDecl
in interface DeclHandler
name
- The name of the entity. If it is a parameter entity, the name will begin with '%'.publicId
- The declared public identifier of the entity, or null if none was declared.systemId
- The declared system identifier of the entity.SAXException
- The application may raise an exception.internalEntityDecl(java.lang.String, java.lang.String)
, DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void setDebugMode(boolean flag)
flag
- determines whether debug info is storedpublic void retainCDATASection(boolean flag)
flag
- determines whether CDATA sections are retainedpublic void setNodeFactory(XMLDocument doc)
doc
- the document to be usedpublic void setNodeFactory(NodeFactory f)
f
- NodeFactorypublic void resetNodeFactory()
public void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
name
- The name of the attribute.value
- The value of the attribute.java.lang.IllegalArgumentException
- thrown if the underlying implementation doesn't recognize the attribute.
|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |