All Packages Class Hierarchy This Package Previous Next Index
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.
This will create a SAXOutputter
without any
registered handler.
This will create a SAXOutputter
with the
specified ContentHandler
.
This will create a SAXOutputter
with the
specified SAX2 handlers.
This will create a SAXOutputter
with the
specified SAX2 handlers.
Creates a SAX XMLReader.
Returns the registered ContentHandler
.
Return the registered DeclHandler
.
Return the registered DTDHandler
.
Return the registered EntityResolver
.
Return the registered ErrorHandler
.
This will look up the value of a SAX feature.
Return the registered LexicalHandler
.
This will look up the value of a SAX property.
This will output the JDOM Document
, firing off the
SAX events that have been registered.
This will set the ContentHandler
.
This will set the DeclHandler
.
This will set the DTDHandler
.
This will set the EntityResolver
.
This will set the ErrorHandler
.
This will set the state of a SAX feature.
This will set the LexicalHandler
.
This will set the value of a SAX property.
This will define whether attribute namespace declarations shall be reported as "xmlns" attributes.
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(ContentHandler contentHandler)
This will create a SAXOutputter
with the
specified ContentHandler
.
ContentHandler
callback methods
public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver)
This will create a SAXOutputter
with the
specified SAX2 handlers. At this time, only ContentHandler
and EntityResolver
are supported.
ContentHandler
callback methods
ErrorHandler
callback methods
DTDHandler
callback methods
EntityResolver
callback methods
public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler)
This will create a SAXOutputter
with the
specified SAX2 handlers. At this time, only ContentHandler
and EntityResolver
are supported.
ContentHandler
callback methods
ErrorHandler
callback methods
DTDHandler
callback methods
EntityResolver
callback methods
LexicalHandler
callbacks.
public void setContentHandler(ContentHandler contentHandler)
This will set the ContentHandler
.
ContentHandler
callback methods.
public ContentHandler getContentHandler()
Returns the registered ContentHandler
.
ContentHandler
or
null
if none was registered.
public void setErrorHandler(ErrorHandler errorHandler)
This will set the ErrorHandler
.
ErrorHandler
callback methods.
public ErrorHandler getErrorHandler()
Return the registered ErrorHandler
.
ErrorHandler
or
null
if none was registered.
public void setDTDHandler(DTDHandler dtdHandler)
This will set the DTDHandler
.
DTDHandler
callback methods.
public DTDHandler getDTDHandler()
Return the registered DTDHandler
.
DTDHandler
or
null
if none was registered.
public void setEntityResolver(EntityResolver entityResolver)
This will set the EntityResolver
.
public EntityResolver getEntityResolver()
Return the registered EntityResolver
.
EntityResolver
or
null
if none was registered.
public void setLexicalHandler(LexicalHandler lexicalHandler)
This will set the LexicalHandler
.
public LexicalHandler getLexicalHandler()
Return the registered LexicalHandler
.
LexicalHandler
or
null
if none was registered.
public void setDeclHandler(DeclHandler declHandler)
This will set the DeclHandler
.
public 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.
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, 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
String
the feature name, which is a
fully-qualified URI.
boolean
the requested state of the
feature (true or false).
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
This will look up the value of a SAX feature.
String
the feature name, which is a
fully-qualified URI.
boolean
the current state of the feature
(true or false).
public void setProperty(String name, Object value) throws SAXNotRecognizedException, 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
String
the property name, which is a
fully-qualified URI.
Object
the requested value for the property.
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
This will look up the value of a SAX property.
String
the property name, which is a
fully-qualified URI.
Object
the current value of the property.
public void output(Document document) throws JDOMException
This will output the JDOM Document
, firing off the
SAX events that have been registered.
JDOM Document
to output.
protected XMLReader createParser() throws Exception
Creates a SAX XMLReader.
XMLReader
a SAX2 parser.
All Packages Class Hierarchy This Package Previous Next Index