|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.batik.dom.util.SAXDocumentFactory
public class SAXDocumentFactory
This class contains methods for creating Document instances from an URI using SAX2.
Nested Class Summary | |
---|---|
protected static interface |
SAXDocumentFactory.PreInfo
|
Field Summary | |
---|---|
protected boolean |
createDocumentDescriptor
Whether a document descriptor must be generated. |
protected Node |
currentNode
The current node. |
protected DocumentType |
doctype
The DTD to use when the document is created. |
protected Document |
document
The created document. |
protected DocumentDescriptor |
documentDescriptor
The created document descriptor. |
protected ErrorHandler |
errorHandler
The error handler. |
protected DOMImplementation |
implementation
The DOM implementation used to create the document. |
protected boolean |
inCDATA
True if the parser is currently parsing a CDATA section. |
protected boolean |
inDTD
True if the parser is currently parsing a DTD. |
protected boolean |
inProlog
Whether the parser still hasn't read the document element's opening tag. |
protected boolean |
isStandalone
Whether the document just parsed was standalone. |
protected boolean |
isValidating
Whether the parser is in validating mode. |
protected Locator |
locator
The locator. |
protected HashTableStack |
namespaces
The stack used to store the namespace URIs. |
protected XMLReader |
parser
The SAX2 parser object. |
protected String |
parserClassName
The SAX2 parser classname. |
protected List |
preInfo
Various elements encountered prior to real document root element. |
protected StringBuffer |
stringBuffer
Contains collected string data. |
protected boolean |
stringContent
Indicates if stringBuffer has content, needed in case of zero sized "text" content. |
protected String |
xmlVersion
XML version of the document just parsed. |
Constructor Summary | |
---|---|
SAXDocumentFactory(DOMImplementation impl,
String parser)
Creates a new SAXDocumentFactory object. |
|
SAXDocumentFactory(DOMImplementation impl,
String parser,
boolean dd)
Creates a new SAXDocumentFactory object. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, notationDecl, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DOMImplementation implementation
protected String parserClassName
protected XMLReader parser
protected Document document
protected DocumentDescriptor documentDescriptor
protected boolean createDocumentDescriptor
protected Node currentNode
protected Locator locator
protected StringBuffer stringBuffer
protected DocumentType doctype
protected boolean stringContent
protected boolean inDTD
protected boolean inCDATA
protected boolean inProlog
protected boolean isValidating
protected boolean isStandalone
protected String xmlVersion
protected HashTableStack namespaces
protected ErrorHandler errorHandler
protected List preInfo
Constructor Detail |
---|
public SAXDocumentFactory(DOMImplementation impl, String parser)
impl
- The DOM implementation to use for building the DOM tree.parser
- The SAX2 parser classname.public SAXDocumentFactory(DOMImplementation impl, String parser, boolean dd)
impl
- The DOM implementation to use for building the DOM tree.parser
- The SAX2 parser classname.dd
- Whether a document descriptor must be generated.Method Detail |
---|
public Document createDocument(String ns, String root, String uri) throws IOException
createDocument
in interface DocumentFactory
ns
- The namespace URI of the root element of the document.root
- The name of the root element of the document.uri
- The document URI.
IOException
- if an error occured while reading the document.public Document createDocument(String uri) throws IOException
uri
- The document URI.
IOException
- if an error occured while reading the document.public Document createDocument(String ns, String root, String uri, InputStream is) throws IOException
createDocument
in interface DocumentFactory
ns
- The namespace URI of the root element of the document.root
- The name of the root element of the document.uri
- The document URI.is
- The document input stream.
IOException
- if an error occured while reading the document.public Document createDocument(String uri, InputStream is) throws IOException
uri
- The document URI.is
- The document input stream.
IOException
- if an error occured while reading the document.public Document createDocument(String ns, String root, String uri, Reader r) throws IOException
createDocument
in interface DocumentFactory
ns
- The namespace URI of the root element of the document.root
- The name of the root element of the document.uri
- The document URI.r
- The document reader.
IOException
- if an error occured while reading the document.public Document createDocument(String ns, String root, String uri, XMLReader r) throws IOException
createDocument
in interface DocumentFactory
ns
- The namespace URI of the root element of the document.root
- The name of the root element of the document.uri
- The document URI.r
- an XMLReaderInstance
IOException
- if an error occured while reading the document.public Document createDocument(String uri, Reader r) throws IOException
uri
- The document URI.r
- The document reader.
IOException
- if an error occured while reading the document.protected Document createDocument(String ns, String root, String uri, InputSource is) throws IOException
ns
- The namespace URI of the root element.root
- The name of the root element.uri
- The document URI.is
- The document input source.
IOException
- if an error occured while reading the document.protected Document createDocument(InputSource is) throws IOException
is
- The document input source.
IOException
- if an error occured while reading the document.public DocumentDescriptor getDocumentDescriptor()
getDocumentDescriptor
in interface DocumentFactory
public void setDocumentLocator(Locator l)
ContentHandler.setDocumentLocator(Locator)
.
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
public void setValidating(boolean isValidating)
setValidating
in interface DocumentFactory
isValidating
- indicates that the XML parser will validate the XML
documentpublic boolean isValidating()
isValidating
in interface DocumentFactory
public void setErrorHandler(ErrorHandler eh)
public DOMImplementation getDOMImplementation(String ver)
public void fatalError(SAXParseException ex) throws SAXException
ErrorHandler.fatalError(SAXParseException)
.
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
SAXException
public void error(SAXParseException ex) throws SAXException
ErrorHandler.error(SAXParseException)
.
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void warning(SAXParseException ex) throws SAXException
ErrorHandler.warning(SAXParseException)
.
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
public void startDocument() throws SAXException
ContentHandler.startDocument()
.
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
public void startElement(String uri, String localName, String rawName, Attributes attributes) throws SAXException
ContentHandler.startElement(String,String,String,Attributes)
.
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String uri, String localName, String rawName) throws SAXException
ContentHandler.endElement(String,String,String)
.
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void appendStringData()
public void characters(char[] ch, int start, int length) throws SAXException
ContentHandler.characters(char[],int,int)
.
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ContentHandler.ignorableWhitespace(char[],int,int)
.
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
ContentHandler.processingInstruction(String,String)
.
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
LexicalHandler.startDTD(String,String,String)
.
startDTD
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
LexicalHandler.endDTD()
.
endDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
LexicalHandler.startEntity(String)
.
startEntity
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
LexicalHandler.endEntity(String)
.
endEntity
in interface LexicalHandler
SAXException
public void startCDATA() throws SAXException
LexicalHandler.startCDATA()
.
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
LexicalHandler.endCDATA()
.
endCDATA
in interface LexicalHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
LexicalHandler.comment(char[],int,int)
.
comment
in interface LexicalHandler
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |