|
||||||||||
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.SAXDocumentFactory
This class contains methods for creating Document instances from an URI using SAX2.
Field Summary | |
protected boolean |
createDocumentDescriptor
Whether a document descriptor must be generated. |
protected Node |
currentNode
The current node. |
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
Whether the parser currently parses a CDATA section. |
protected boolean |
inDTD
Whether the parser currently parses a DTD. |
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 java.lang.String |
parserClassName
The SAX2 parser classname. |
protected java.util.List |
preInfo
Various elements encountered prior to real document root element. |
Constructor Summary | |
SAXDocumentFactory(DOMImplementation impl,
java.lang.String parser)
Creates a new SAXDocumentFactory object. |
|
SAXDocumentFactory(DOMImplementation impl,
java.lang.String parser,
boolean dd)
Creates a new SAXDocumentFactory 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) . |
protected Document |
createDocument(InputSource is)
Creates a Document. |
Document |
createDocument(java.lang.String uri)
Creates a Document instance. |
Document |
createDocument(java.lang.String uri,
java.io.InputStream is)
Creates a Document instance. |
Document |
createDocument(java.lang.String uri,
java.io.Reader r)
Creates a Document instance. |
Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri)
Creates a Document instance. |
protected Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri,
InputSource is)
Creates a Document. |
Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri,
java.io.InputStream is)
Creates a Document instance. |
Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri,
java.io.Reader r)
Creates a Document instance. |
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 |
error(SAXParseException ex)
SAX: Implements ErrorHandler.error(SAXParseException) . |
void |
fatalError(SAXParseException ex)
SAX: Implements ErrorHandler.fatalError(SAXParseException) . |
DocumentDescriptor |
getDocumentDescriptor()
Returns the document descriptor associated with the latest created document. |
boolean |
isValidating()
Returns true if the XML parser validates the XML stream, false otherwise. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
SAX: Implements ContentHandler.processingInstruction(String,String) . |
void |
setDocumentLocator(Locator l)
SAX: Implements ContentHandler.setDocumentLocator(Locator) . |
void |
setErrorHandler(ErrorHandler eh)
Sets a custom error handler. |
void |
setValidating(boolean isValidating)
Sets whether or not the XML parser will validate the XML document depending on the specified parameter. |
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) . |
void |
warning(SAXParseException ex)
SAX: Implements ErrorHandler.warning(SAXParseException) . |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, ignorableWhitespace, 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 java.lang.String parserClassName
protected Document document
protected DocumentDescriptor documentDescriptor
protected boolean createDocumentDescriptor
protected Node currentNode
protected Locator locator
protected boolean inCDATA
protected boolean inDTD
protected boolean isValidating
protected HashTableStack namespaces
protected ErrorHandler errorHandler
protected java.util.List preInfo
Constructor Detail |
public SAXDocumentFactory(DOMImplementation impl, java.lang.String parser)
impl
- The DOM implementation to use for building the DOM tree.parser
- The SAX2 parser classname.public SAXDocumentFactory(DOMImplementation impl, java.lang.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(java.lang.String ns, java.lang.String root, java.lang.String uri) throws java.io.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.java.io.IOException
- if an error occured while reading the document.public Document createDocument(java.lang.String uri) throws java.io.IOException
uri
- The document URI.java.io.IOException
- if an error occured while reading the document.public Document createDocument(java.lang.String ns, java.lang.String root, java.lang.String uri, java.io.InputStream is) throws java.io.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.java.io.IOException
- if an error occured while reading the document.public Document createDocument(java.lang.String uri, java.io.InputStream is) throws java.io.IOException
uri
- The document URI.is
- The document input stream.java.io.IOException
- if an error occured while reading the document.public Document createDocument(java.lang.String ns, java.lang.String root, java.lang.String uri, java.io.Reader r) throws java.io.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.java.io.IOException
- if an error occured while reading the document.public Document createDocument(java.lang.String uri, java.io.Reader r) throws java.io.IOException
uri
- The document URI.r
- The document reader.java.io.IOException
- if an error occured while reading the document.protected Document createDocument(java.lang.String ns, java.lang.String root, java.lang.String uri, InputSource is) throws java.io.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.java.io.IOException
- if an error occured while reading the document.protected Document createDocument(InputSource is) throws java.io.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.java.io.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 class DefaultHandler
org.xml.sax.helpers.DefaultHandler
locator
- A locator for all SAX document events.ContentHandler.setDocumentLocator(org.xml.sax.Locator)
,
Locator
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 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 fatalError(SAXParseException ex) throws SAXException
ErrorHandler.fatalError(SAXParseException)
.fatalError
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
e
- The error information encoded as an exception.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
,
SAXParseException
public void error(SAXParseException ex) throws SAXException
ErrorHandler.error(SAXParseException)
.error
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
e
- The warning information encoded as an exception.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void warning(SAXParseException ex) throws SAXException
ErrorHandler.warning(SAXParseException)
.warning
in class DefaultHandler
org.xml.sax.helpers.DefaultHandler
e
- The warning information encoded as an exception.SAXException
- Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
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 |