|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | 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.
| 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 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. |
Document |
createDocument(java.lang.String ns,
java.lang.String root,
java.lang.String uri,
XMLReader 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 DocumentFactoryns - 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 DocumentFactoryns - 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 DocumentFactoryns - 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 ns,
java.lang.String root,
java.lang.String uri,
XMLReader r)
throws java.io.IOException
createDocument in interface DocumentFactoryns - 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
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
is - The document input source.
java.io.IOException - if an error occured while reading the document.public DocumentDescriptor getDocumentDescriptor()
getDocumentDescriptor in interface DocumentFactorypublic void setDocumentLocator(Locator l)
ContentHandler.setDocumentLocator(Locator).
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerpublic void setValidating(boolean isValidating)
setValidating in interface DocumentFactoryisValidating - indicates that the XML parser will validate the XML
documentpublic boolean isValidating()
isValidating in interface DocumentFactorypublic void setErrorHandler(ErrorHandler eh)
public void startDocument()
throws SAXException
ContentHandler.startDocument().
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXException
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 interface ContentHandlerstartElement in class DefaultHandlerSAXException
public void fatalError(SAXParseException ex)
throws SAXException
ErrorHandler.fatalError(SAXParseException).
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerSAXException
public void error(SAXParseException ex)
throws SAXException
ErrorHandler.error(SAXParseException).
error in interface ErrorHandlererror in class DefaultHandlerSAXException
public void warning(SAXParseException ex)
throws SAXException
ErrorHandler.warning(SAXParseException).
warning in interface ErrorHandlerwarning in class DefaultHandlerSAXException
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
throws SAXException
ContentHandler.endElement(String,String,String).
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
ContentHandler.characters(char[],int,int).
characters in interface ContentHandlercharacters in class DefaultHandlerSAXException
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws SAXException
ContentHandler.processingInstruction(String,String).
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlerSAXException
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 LexicalHandlerSAXException
public void endDTD()
throws SAXException
LexicalHandler.endDTD().
endDTD in interface LexicalHandlerSAXException
public void startEntity(java.lang.String name)
throws SAXException
LexicalHandler.startEntity(String).
startEntity in interface LexicalHandlerSAXException
public void endEntity(java.lang.String name)
throws SAXException
LexicalHandler.endEntity(String).
endEntity in interface LexicalHandlerSAXException
public void startCDATA()
throws SAXException
LexicalHandler.startCDATA().
startCDATA in interface LexicalHandlerSAXException
public void endCDATA()
throws SAXException
LexicalHandler.endCDATA().
endCDATA in interface LexicalHandlerSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
LexicalHandler.comment(char[],int,int).
comment in interface LexicalHandlerSAXException
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||