All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.jdom.output.SAXOutputter

java.lang.Object
   |
   +----org.jdom.output.SAXOutputter

public class SAXOutputter
extends Object

SAXOutputter takes a JDOM tree and fires SAX2 events.

Most 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.

Version:
1.0
Author:
Brett McLaughlin, Jason Hunter, Fred Trimble

Constructor Index

 o SAXOutputter(ContentHandler)

This will create a SAXOutputter with the specified ContentHandler.

 o SAXOutputter(ContentHandler, ErrorHandler, DTDHandler, EntityResolver)

This will create a SAXOutputter with the specified SAX2 handlers.

Method Index

 o output(Document)

This will output the JDOM Document, firing off the SAX events that have been registered.

 o setContentHandler(ContentHandler)

This will set the ContentHandler.

 o setDTDHandler(DTDHandler)

This will set the DTDHandler.

 o setEntityResolver(EntityResolver)

This will set the EntityResolver.

 o setErrorHandler(ErrorHandler)

This will set the ErrorHandler.

 o setReportNamespaceDeclarations(boolean)

This will define whether attribute namespace declarations shall be reported as "xmlns" attributes.

Constructors

 o SAXOutputter
 public SAXOutputter(ContentHandler contentHandler)

This will create a SAXOutputter with the specified ContentHandler.

Parameters:
contentHandler - contains ContentHandler callback methods
 o SAXOutputter
 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.

Parameters:
contentHandler - contains ContentHandler callback methods
errorHandler - contains ErrorHandler callback methods
dtdHandler - contains DTDHandler callback methods
entityResolver - contains EntityResolver callback methods

Methods

 o setContentHandler
 public void setContentHandler(ContentHandler contentHandler)

This will set the ContentHandler.

Parameters:
contentHandler - contains ContentHandler callback methods.
 o setErrorHandler
 public void setErrorHandler(ErrorHandler errorHandler)

This will set the ErrorHandler.

Parameters:
errorHandler - contains ErrorHandler callback methods.
 o setDTDHandler
 public void setDTDHandler(DTDHandler dtdHandler)

This will set the DTDHandler.

Parameters:
dtdHandler - contains DTDHandler callback methods.
 o setEntityResolver
 public void setEntityResolver(EntityResolver entityResolver)

This will set the EntityResolver.

Parameters:
entityResolver - contains EntityResolver callback methods.
 o setReportNamespaceDeclarations
 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.

Parameters:
reportDecl - whether attribute namespace declarations shall be reported as "xmlns" attributes.
 o output
 public void output(Document document) throws JDOMException

This will output the JDOM Document, firing off the SAX events that have been registered.

Parameters:
document - JDOM Document to output.

All Packages  Class Hierarchy  This Package  Previous  Next  Index