|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.apache.batik.dom.util.DocumentFactory
This class contains methods for creating Document instances from an URI using SAX2.
Field Summary | |
protected Node |
currentNode
The current node. |
protected Document |
document
The created document. |
protected boolean |
documentElementParsed
Whether the document element has been parsed. |
protected DOMImplementation |
implementation
The DOM implementation used to create the document. |
protected boolean |
inCDATA
Whether the parser currently parses a CDATA section. |
protected boolean |
inDTD
Whether the parser currently parses a DTD. |
protected HashTableStack |
namespaces
The stack used to store the namespace URIs. |
protected java.lang.String |
parserClassName
The SAX2 parser classname. |
Constructor Summary | |
DocumentFactory(DOMImplementation impl,
java.lang.String parser)
Creates a new DocumentFactory object. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
SAX: Implements ContentHandler.characters(char[],int,int) . |
void |
comment(char[] ch,
int start,
int length)
SAX: Implements LexicalHandler.comment(char[],int,int) . |
Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri,
InputSource is)
Creates a GenericDocument. |
void |
endCDATA()
SAX: Implements LexicalHandler.endCDATA() . |
void |
endDTD()
SAX: Implements LexicalHandler.endDTD() . |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
SAX: Implements ContentHandler.endElement(String,String,String) . |
void |
endEntity(java.lang.String name)
SAX: Implements LexicalHandler.endEntity(String) . |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
SAX: Implements ContentHandler.processingInstruction(String,String) . |
void |
startCDATA()
SAX: Implements LexicalHandler.startCDATA() . |
void |
startDocument()
SAX: Implements ContentHandler.startDocument() . |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
SAX: Implements LexicalHandler.startDTD(String,String,String) . |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
Attributes attributes)
SAX: Implements ContentHandler.startElement(String,String,String,Attributes) . |
void |
startEntity(java.lang.String name)
SAX: Implements LexicalHandler.startEntity(String) . |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DOMImplementation implementation
protected java.lang.String parserClassName
protected Document document
protected Node currentNode
protected boolean inCDATA
protected boolean inDTD
protected boolean documentElementParsed
protected HashTableStack namespaces
Constructor Detail |
public DocumentFactory(DOMImplementation impl, java.lang.String parser)
impl
- The DOM implementation to use for building the DOM tree.parser
- The SAX2 parser classname.Method Detail |
public Document createDocument(java.lang.String ns, java.lang.String root, java.lang.String uri, InputSource is) throws DOMException, SAXException, java.lang.InterruptedException
ns
- The namespace URI of the root element.root
- The name of the root element.uri
- The document URI.is
- The document input source.DOMException
- if an error occured when building the document.SAXException
- if an error occured when reading the document.java.lang.InterruptedException
- if the current thread is interrupted.public void startDocument() throws SAXException
ContentHandler.startDocument()
.startDocument
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startDocument()
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, Attributes attributes) throws SAXException
ContentHandler.startElement(String,String,String,Attributes)
.startElement
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
name
- The element type name.attributes
- The specified or defaulted attributes.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName) throws SAXException
ContentHandler.endElement(String,String,String)
.endElement
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
name
- The element type name.attributes
- The specified or defaulted attributes.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void characters(char[] ch, int start, int length) throws SAXException
ContentHandler.characters(char[],int,int)
.characters
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
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.ContentHandler.characters(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
ContentHandler.processingInstruction(String,String)
.processingInstruction
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
target
- The processing instruction target.data
- The processing instruction data, or null if
none is supplied.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
LexicalHandler.startDTD(String,String,String)
.startDTD
in interface LexicalHandler
org.xml.sax.ext.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.LexicalHandler.endDTD()
,
LexicalHandler.startEntity(java.lang.String)
public void endDTD() throws SAXException
LexicalHandler.endDTD()
.endDTD
in interface LexicalHandler
org.xml.sax.ext.LexicalHandler
SAXException
- The application may raise an exception.LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void startEntity(java.lang.String name) throws SAXException
LexicalHandler.startEntity(String)
.startEntity
in interface LexicalHandler
org.xml.sax.ext.LexicalHandler
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.SAXException
- The application may raise an exception.LexicalHandler.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
LexicalHandler.endEntity(String)
.endEntity
in interface LexicalHandler
org.xml.sax.ext.LexicalHandler
name
- The name of the entity that is ending.SAXException
- The application may raise an exception.LexicalHandler.startEntity(java.lang.String)
public void startCDATA() throws SAXException
LexicalHandler.startCDATA()
.startCDATA
in interface LexicalHandler
org.xml.sax.ext.LexicalHandler
SAXException
- The application may raise an exception.LexicalHandler.endCDATA()
public void endCDATA() throws SAXException
LexicalHandler.endCDATA()
.endCDATA
in interface LexicalHandler
org.xml.sax.ext.LexicalHandler
SAXException
- The application may raise an exception.LexicalHandler.startCDATA()
public void comment(char[] ch, int start, int length) throws SAXException
LexicalHandler.comment(char[],int,int)
.comment
in interface LexicalHandler
org.xml.sax.ext.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |