|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jdom.output.SAXOutputter
SAXOutputter
takes a JDOM tree and fires SAX2 events.
ContentHandler
callbacks are supported. Both
ignorableWhitespace
and skippedEntity
have
not been implemented. The setDocumentLocator
callback has
been implemented, but the locator object always returns -1 for
getColumnNumber
and getLineNumber
.
The EntityResolver
callback resolveEntity
has
been implemented for DTDs.
At this time, it is not possible to access notations and unparsed entity
references in a DTD from a JDOM tree. Therefore, DTDHandler
callbacks have not been implemented yet.
The ErrorHandler
callbacks have not been implemented, since
these are supposed to be invoked when the document is parsed. However, the
document has already been parsed in order to create the JDOM tree.
Constructor Summary | |
SAXOutputter()
This will create a SAXOutputter without any
registered handler. |
|
SAXOutputter(org.xml.sax.ContentHandler contentHandler)
This will create a SAXOutputter with the
specified ContentHandler . |
|
SAXOutputter(org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
org.xml.sax.DTDHandler dtdHandler,
org.xml.sax.EntityResolver entityResolver)
This will create a SAXOutputter with the
specified SAX2 handlers. |
|
SAXOutputter(org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler,
org.xml.sax.DTDHandler dtdHandler,
org.xml.sax.EntityResolver entityResolver,
org.xml.sax.ext.LexicalHandler lexicalHandler)
This will create a SAXOutputter with the
specified SAX2 handlers. |
Method Summary | |
protected org.xml.sax.XMLReader |
createParser()
Creates a SAX XMLReader. |
org.xml.sax.ContentHandler |
getContentHandler()
Returns the registered ContentHandler . |
org.xml.sax.ext.DeclHandler |
getDeclHandler()
Return the registered DeclHandler . |
org.xml.sax.DTDHandler |
getDTDHandler()
Return the registered DTDHandler . |
org.xml.sax.EntityResolver |
getEntityResolver()
Return the registered EntityResolver . |
org.xml.sax.ErrorHandler |
getErrorHandler()
Return the registered ErrorHandler . |
boolean |
getFeature(java.lang.String name)
This will look up the value of a SAX feature. |
org.xml.sax.ext.LexicalHandler |
getLexicalHandler()
Return the registered LexicalHandler . |
java.lang.Object |
getProperty(java.lang.String name)
This will look up the value of a SAX property. |
void |
output(Document document)
This will output the JDOM Document , firing off the
SAX events that have been registered. |
void |
setContentHandler(org.xml.sax.ContentHandler contentHandler)
This will set the ContentHandler . |
void |
setDeclHandler(org.xml.sax.ext.DeclHandler declHandler)
This will set the DeclHandler . |
void |
setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
This will set the DTDHandler . |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
This will set the EntityResolver . |
void |
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
This will set the ErrorHandler . |
void |
setFeature(java.lang.String name,
boolean value)
This will set the state of a SAX feature. |
void |
setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
This will set the LexicalHandler . |
void |
setProperty(java.lang.String name,
java.lang.Object value)
This will set the value of a SAX property. |
void |
setReportNamespaceDeclarations(boolean declareNamespaces)
This will define whether attribute namespace declarations shall be reported as "xmlns" attributes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SAXOutputter()
This will create a SAXOutputter
without any
registered handler. The application is then responsible for
registering them using the setXxxHandler()
methods.
public SAXOutputter(org.xml.sax.ContentHandler contentHandler)
This will create a SAXOutputter
with the
specified ContentHandler
.
contentHandler
- contains ContentHandler
callback methodspublic SAXOutputter(org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler, org.xml.sax.DTDHandler dtdHandler, org.xml.sax.EntityResolver entityResolver)
This will create a SAXOutputter
with the
specified SAX2 handlers. At this time, only ContentHandler
and EntityResolver
are supported.
contentHandler
- contains ContentHandler
callback methodserrorHandler
- contains ErrorHandler
callback methodsdtdHandler
- contains DTDHandler
callback methodsentityResolver
- contains EntityResolver
callback methodspublic SAXOutputter(org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler, org.xml.sax.DTDHandler dtdHandler, org.xml.sax.EntityResolver entityResolver, org.xml.sax.ext.LexicalHandler lexicalHandler)
This will create a SAXOutputter
with the
specified SAX2 handlers. At this time, only ContentHandler
and EntityResolver
are supported.
contentHandler
- contains ContentHandler
callback methodserrorHandler
- contains ErrorHandler
callback methodsdtdHandler
- contains DTDHandler
callback methodsentityResolver
- contains EntityResolver
callback methodslexicalHandler
- contains LexicalHandler
callbacks.Method Detail |
public void setContentHandler(org.xml.sax.ContentHandler contentHandler)
This will set the ContentHandler
.
contentHandler
- contains ContentHandler
callback methods.public org.xml.sax.ContentHandler getContentHandler()
Returns the registered ContentHandler
.
ContentHandler
or
null
if none was registered.public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
This will set the ErrorHandler
.
errorHandler
- contains ErrorHandler
callback methods.public org.xml.sax.ErrorHandler getErrorHandler()
Return the registered ErrorHandler
.
ErrorHandler
or
null
if none was registered.public void setDTDHandler(org.xml.sax.DTDHandler dtdHandler)
This will set the DTDHandler
.
dtdHandler
- contains DTDHandler
callback methods.public org.xml.sax.DTDHandler getDTDHandler()
Return the registered DTDHandler
.
DTDHandler
or
null
if none was registered.public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
This will set the EntityResolver
.
entityResolver
- contains EntityResolver callback methods.public org.xml.sax.EntityResolver getEntityResolver()
Return the registered EntityResolver
.
EntityResolver
or
null
if none was registered.public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
This will set the LexicalHandler
.
lexicalHandler
- contains lexical callback methods.public org.xml.sax.ext.LexicalHandler getLexicalHandler()
Return the registered LexicalHandler
.
LexicalHandler
or
null
if none was registered.public void setDeclHandler(org.xml.sax.ext.DeclHandler declHandler)
This will set the DeclHandler
.
declHandler
- contains declaration callback methods.public org.xml.sax.ext.DeclHandler getDeclHandler()
Return the registered DeclHandler
.
DeclHandler
or
null
if none was registered.public void setReportNamespaceDeclarations(boolean declareNamespaces)
This will define whether attribute namespace declarations shall be
reported as "xmlns" attributes. This flag defaults to false
and behaves as the "namespace-prefixes" SAX core feature.
reportDecl
- whether attribute namespace declarations shall be
reported as "xmlns" attributes.public void setFeature(java.lang.String name, boolean value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
This will set the state of a SAX feature.
All XMLReaders are required to support setting to true and to false.
SAXOutputter currently supports the following SAX core features:
http://xml.org/sax/features/namespaces
true
!http://xml.org/sax/features/namespace-prefixes
name
- String
the feature name, which is a
fully-qualified URI.value
- boolean
the requested state of the
feature (true or false).org.xml.sax.SAXNotRecognizedException
- When SAXOutputter does not
recognize the feature name.org.xml.sax.SAXNotSupportedException
- When SAXOutputter recognizes
the feature name but cannot set the requested value.public boolean getFeature(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
This will look up the value of a SAX feature.
name
- String
the feature name, which is a
fully-qualified URI.boolean
the current state of the feature
(true or false).org.xml.sax.SAXNotRecognizedException
- When SAXOutputter does not
recognize the feature name.org.xml.sax.SAXNotSupportedException
- When SAXOutputter recognizes
the feature name but determine its value at this time.public void setProperty(java.lang.String name, java.lang.Object value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
This will set the value of a SAX property. This method is also the standard mechanism for setting extended handlers.
SAXOutputter currently supports the following SAX properties:
http://xml.org/sax/properties/lexical-handler
org.xml.sax.ext.LexicalHandler
http://xml.org/sax/properties/declaration-handler
org.xml.sax.ext.DeclHandler
name
- String
the property name, which is a
fully-qualified URI.value
- Object
the requested value for the property.org.xml.sax.SAXNotRecognizedException
- When SAXOutputter does not recognize
the property name.org.xml.sax.SAXNotSupportedException
- When SAXOutputter recognizes the
property name but cannot set the requested value.public java.lang.Object getProperty(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
This will look up the value of a SAX property.
name
- String
the property name, which is a
fully-qualified URI.Object
the current value of the property.org.xml.sax.SAXNotRecognizedException
- When SAXOutputter does not recognize
the property name.org.xml.sax.SAXNotSupportedException
- When SAXOutputter recognizes the
property name but cannot determine its value at this time.public void output(Document document) throws JDOMException
This will output the JDOM Document
, firing off the
SAX events that have been registered.
document
- JDOM Document
to output.protected org.xml.sax.XMLReader createParser() throws java.lang.Exception
Creates a SAX XMLReader.
XMLReader
a SAX2 parser.java.lang.Exception
- if no parser can be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |