Main Page   Packages   Namespace List   Class Hierarchy   Compound List   Compound Members  

SAXOutputter Class Reference

List of all members.

Public Methods

 SAXOutputter ()
 SAXOutputter (ContentHandler contentHandler)
 SAXOutputter (ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver)
 SAXOutputter (ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler)
void setContentHandler (ContentHandler contentHandler)
ContentHandler getContentHandler ()
void setErrorHandler (ErrorHandler errorHandler)
ErrorHandler getErrorHandler ()
void setDTDHandler (DTDHandler dtdHandler)
DTDHandler getDTDHandler ()
void setEntityResolver (EntityResolver entityResolver)
EntityResolver getEntityResolver ()
void setLexicalHandler (LexicalHandler lexicalHandler)
LexicalHandler getLexicalHandler ()
void setDeclHandler (DeclHandler declHandler)
DeclHandler getDeclHandler ()
void setReportNamespaceDeclarations (boolean declareNamespaces)
void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
boolean getFeature (String name) throws SAXNotRecognizedException, SAXNotSupportedException
void setProperty (String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
Object getProperty (String name) throws SAXNotRecognizedException, SAXNotSupportedException
void output (Document document) throws JDOMException

Protected Methods

XMLReader createParser () throws Exception

Detailed Description

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.

Author:
Brett McLaughlin , Jason Hunter , Fred Trimble , Bradley S. Huffman
Version:
Revision:
1.18
,
Date:
2002/01/08 09:17:10


Constructor & Destructor Documentation

SAXOutputter::SAXOutputter   [inline]
 

This will create a SAXOutputter without any registered handler. The application is then responsible for registering them using the setXxxHandler() methods.

SAXOutputter::SAXOutputter ContentHandler    contentHandler [inline]
 

This will create a SAXOutputter with the specified ContentHandler.

Parameters:
contentHandler  contains ContentHandler callback methods

SAXOutputter::SAXOutputter ContentHandler    contentHandler,
ErrorHandler    errorHandler,
DTDHandler    dtdHandler,
EntityResolver    entityResolver
[inline]
 

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

SAXOutputter::SAXOutputter ContentHandler    contentHandler,
ErrorHandler    errorHandler,
DTDHandler    dtdHandler,
EntityResolver    entityResolver,
LexicalHandler    lexicalHandler
[inline]
 

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
lexicalHandler  contains LexicalHandler callbacks.


Member Function Documentation

XMLReader SAXOutputter::createParser   [inline, protected]
 

Creates a SAX XMLReader.

Returns:
XMLReader a SAX2 parser.
Exceptions:
Exception  if no parser can be created.

ContentHandler SAXOutputter::getContentHandler   [inline]
 

Returns the registered ContentHandler.

Returns:
the current ContentHandler or null if none was registered.

DeclHandler SAXOutputter::getDeclHandler   [inline]
 

Return the registered DeclHandler.

Returns:
the current DeclHandler or null if none was registered.

DTDHandler SAXOutputter::getDTDHandler   [inline]
 

Return the registered DTDHandler.

Returns:
the current DTDHandler or null if none was registered.

EntityResolver SAXOutputter::getEntityResolver   [inline]
 

Return the registered EntityResolver.

Returns:
the current EntityResolver or null if none was registered.

ErrorHandler SAXOutputter::getErrorHandler   [inline]
 

Return the registered ErrorHandler.

Returns:
the current ErrorHandler or null if none was registered.

boolean SAXOutputter::getFeature String    name [inline]
 

This will look up the value of a SAX feature.

Parameters:
name  String the feature name, which is a fully-qualified URI.
Returns:
boolean the current state of the feature (true or false).
Exceptions:
SAXNotRecognizedException  When SAXOutputter does not recognize the feature name.
SAXNotSupportedException  When SAXOutputter recognizes the feature name but determine its value at this time.

LexicalHandler SAXOutputter::getLexicalHandler   [inline]
 

Return the registered LexicalHandler.

Returns:
the current LexicalHandler or null if none was registered.

Object SAXOutputter::getProperty String    name [inline]
 

This will look up the value of a SAX property.

Parameters:
name  String the property name, which is a fully-qualified URI.
Returns:
Object the current value of the property.
Exceptions:
SAXNotRecognizedException  When SAXOutputter does not recognize the property name.
SAXNotSupportedException  When SAXOutputter recognizes the property name but cannot determine its value at this time.

void SAXOutputter::output Document    document [inline]
 

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

Parameters:
document  JDOM Document to output.

void SAXOutputter::setContentHandler ContentHandler    contentHandler [inline]
 

This will set the ContentHandler.

Parameters:
contentHandler  contains ContentHandler callback methods.

void SAXOutputter::setDeclHandler DeclHandler    declHandler [inline]
 

This will set the DeclHandler.

Parameters:
declHandler  contains declaration callback methods.

void SAXOutputter::setDTDHandler DTDHandler    dtdHandler [inline]
 

This will set the DTDHandler.

Parameters:
dtdHandler  contains DTDHandler callback methods.

void SAXOutputter::setEntityResolver EntityResolver    entityResolver [inline]
 

This will set the EntityResolver.

Parameters:
entityResolver  contains EntityResolver callback methods.

void SAXOutputter::setErrorHandler ErrorHandler    errorHandler [inline]
 

This will set the ErrorHandler.

Parameters:
errorHandler  contains ErrorHandler callback methods.

void SAXOutputter::setFeature String    name,
boolean    value
[inline]
 

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
description: An optional extension handler for lexical events like comments.
access: read/write, but always true!
http://xml.org/sax/features/namespace-prefixes
description: An optional extension handler for DTD-related events other than notations and unparsed entities.
access: read/write
Parameters:
name  String the feature name, which is a fully-qualified URI.
value  boolean the requested state of the feature (true or false).
Exceptions:
SAXNotRecognizedException  When SAXOutputter does not recognize the feature name.
SAXNotSupportedException  When SAXOutputter recognizes the feature name but cannot set the requested value.

void SAXOutputter::setLexicalHandler LexicalHandler    lexicalHandler [inline]
 

This will set the LexicalHandler.

Parameters:
lexicalHandler  contains lexical callback methods.

void SAXOutputter::setProperty String    name,
Object    value
[inline]
 

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
data type: org.xml.sax.ext.LexicalHandler
description: An optional extension handler for lexical events like comments.
access: read/write
http://xml.org/sax/properties/declaration-handler
data type: org.xml.sax.ext.DeclHandler
description: An optional extension handler for DTD-related events other than notations and unparsed entities.
access: read/write
Parameters:
name  String the property name, which is a fully-qualified URI.
value  Object the requested value for the property.
Exceptions:
SAXNotRecognizedException  When SAXOutputter does not recognize the property name.
SAXNotSupportedException  When SAXOutputter recognizes the property name but cannot set the requested value.

void SAXOutputter::setReportNamespaceDeclarations boolean    declareNamespaces [inline]
 

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.


The documentation for this class was generated from the following file:
Generated on Sat Mar 30 18:53:04 2002 for JDOM by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001