Most ContentHandler callbacks are supported. BOTH
ignorableWhitespace() and skippedEntity() have not
been implemented. The class returned by
JDOMLocator exposes the current node being operated
upon.
getLocator
At this time, it is not possible to access notations and unparsed entity
references in a DTD from JDOM. 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 and at this
point the document exists in memory and is known to have no errors.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private ContentHandler | contentHandler
registered |
| private boolean | declareNamespaces
Whether to report attribute namespace declarations as xmlns attributes. |
| private DeclHandler | declHandler
registered |
| private static final SAXOutputProcessor | |
| private DTDHandler | dtdHandler
registered |
| private EntityResolver | entityResolver
registered |
| private ErrorHandler | errorHandler
registered |
| private Format | format
The Format to use for output. |
| private LexicalHandler | lexicalHandler
registered |
| private SAXOutputProcessor | processor
A SAXOutputProcessor |
| private boolean | reportDtdEvents
Whether to report DTD events to DeclHandlers and LexicalHandlers. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SAXOutputter(ContentHandler
contains contentHandler)ContentHandler callback methodsThis will create a |
| public | SAXOutputter(ContentHandler
contains contentHandler, ErrorHandler ContentHandler callback methodscontains errorHandler, DTDHandler ErrorHandler callback methodscontains dtdHandler, EntityResolver DTDHandler callback methodscontains entityResolver)EntityResolver callback methodsThis will create a |
| public | SAXOutputter(ContentHandler
contains contentHandler, ErrorHandler ContentHandler callback methodscontains errorHandler, DTDHandler ErrorHandler callback methodscontains dtdHandler, EntityResolver DTDHandler callback methodscontains entityResolver, LexicalHandler EntityResolver callback methodscontains lexicalHandler)LexicalHandler callbacks.This will create a |
| public | SAXOutputter(SAXOutputProcessor
the processor, Format SAXOutputProcessor to use for output.the format, ContentHandler Format to use for output.contains contentHandler, ErrorHandler ContentHandler callback methodscontains errorHandler, DTDHandler ErrorHandler callback methodscontains dtdHandler, EntityResolver DTDHandler callback methodscontains entityResolver, LexicalHandler EntityResolver callback methodscontains lexicalHandler)LexicalHandler callbacks.This will create a |
| Modifier and Type | Method and Description |
|---|---|
| private final SAXTarget | |
| public ContentHandler | Returns: the currentContentHandler or null if
none was registered.Returns the registered |
| public DeclHandler | Returns: the currentDeclHandler or null if none
was registered.Return the registered |
| public DTDHandler | Returns: the currentDTDHandler or null if none
was registered.Return the registered |
| public EntityResolver | Returns: the currentEntityResolver or null if
none was registered.Return the registered |
| public ErrorHandler | Returns: the currentErrorHandler or null if
none was registered.Return the registered |
| public boolean | Returns: boolean the current state of the feature (true or
false).String the feature name, which is a fully-qualified
URI.This will look up the value of a SAX feature. |
| public Format | |
| public LexicalHandler | Returns: the currentLexicalHandler or null if
none was registered.Return the registered |
| public JDOMLocator | Returns: null
Deprecated
there is no way to get a meaningful document Locator outside
of an active output process, and the contents of the locator
are meaningless outside of an active output process anyway.
Returns null.
|
| public Object | Returns: Object the current value of the property.String the property name, which is a fully-qualified
URI.This will look up the value of a SAX property. |
| public boolean | Returns: whether DTD events will be reportedReturns whether DTD events will be reported. |
| public boolean | Returns: whether attribute namespace declarations shall be reported as "xmlns" attributes.Returns whether attribute namespace declarations shall be reported as "xmlns" attributes. |
| public SAXOutputProcessor | Returns: The current SAXOutputProcessorGet the current |
| private void | handleError(JDOMException
JDOMException containing the
error information; will be wrapped in a
SAXParseException when reported to
the SAX error handler.
Notifies the registered |
| public void | |
| public void | |
| public void | |
| public void | outputFragment(List<? extends Content>
List of JDOM nodes to output.This will output a list of JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered. |
| public void | outputFragment(Content
the node)Content node to output.This will output a single JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered. |
| public void | setContentHandler(ContentHandler
contains contentHandler)ContentHandler callback methods.This will set the |
| public void | setDeclHandler(DeclHandler
contains declaration callback methods. declHandler)This will set the |
| public void | setDTDHandler(DTDHandler
contains dtdHandler)DTDHandler callback methods.This will set the |
| public void | setEntityResolver(EntityResolver
contains EntityResolver callback methods. entityResolver)This will set the |
| public void | setErrorHandler(ErrorHandler
contains errorHandler)ErrorHandler callback methods.This will set the |
| public void | setFeature(String
String the feature name, which is a fully-qualified
URI.boolean the requested state of the feature (true or
false).This will set the state of a SAX feature. |
| public void | |
| public void | setLexicalHandler(LexicalHandler
contains lexical callback methods. lexicalHandler)This will set the |
| public void | setProperty(String
String the property name, which is a fully-qualified
URI.Object the requested value for the property.This will set the value of a SAX property. |
| public void | setReportDTDEvents(boolean
whether to notify DTD events. reportDtdEvents)This will define whether to report DTD events to SAX DeclHandlers and LexicalHandlers if these handlers are registered and the document to output includes a DocType declaration. |
| public void | setReportNamespaceDeclarations(boolean
whether attribute namespace declarations shall be reported as
"xmlns" attributes. declareNamespaces)This will define whether attribute namespace declarations shall be reported as "xmlns" attributes. |
| public void | setSAXOutputProcessor(SAXOutputProcessor
the new SAXOutputProcessor processor)Set the current |
| contentHandler | back to summary |
|---|---|
| private ContentHandler contentHandler registered | |
| declareNamespaces | back to summary |
|---|---|
| private boolean declareNamespaces Whether to report attribute namespace declarations as xmlns attributes.
Defaults to
| |
| declHandler | back to summary |
|---|---|
| private DeclHandler declHandler registered | |
| DEFAULT_PROCESSOR | back to summary |
|---|---|
| private static final SAXOutputProcessor DEFAULT_PROCESSOR | |
| dtdHandler | back to summary |
|---|---|
| private DTDHandler dtdHandler registered | |
| entityResolver | back to summary |
|---|---|
| private EntityResolver entityResolver registered | |
| errorHandler | back to summary |
|---|---|
| private ErrorHandler errorHandler registered | |
| format | back to summary |
|---|---|
| private Format format The Format to use for output. | |
| lexicalHandler | back to summary |
|---|---|
| private LexicalHandler lexicalHandler registered | |
| processor | back to summary |
|---|---|
| private SAXOutputProcessor processor A SAXOutputProcessor | |
| reportDtdEvents | back to summary |
|---|---|
| private boolean reportDtdEvents Whether to report DTD events to DeclHandlers and LexicalHandlers.
Defaults to | |
| SAXOutputter | back to summary |
|---|---|
| public SAXOutputter() This will create a | |
| SAXOutputter | back to summary |
|---|---|
| public SAXOutputter(ContentHandler contentHandler) This will create a
| |
| SAXOutputter | back to summary |
|---|---|
| public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver) This will create a
| |
| SAXOutputter | back to summary |
|---|---|
| public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler) This will create a
| |
| SAXOutputter | back to summary |
|---|---|
| public SAXOutputter(SAXOutputProcessor processor, Format format, ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler) This will create a
| |
| buildTarget | back to summary |
|---|---|
| private final SAXTarget buildTarget(Document doc) | |
| getContentHandler | back to summary |
|---|---|
| public ContentHandler getContentHandler() Returns the registered
| |
| getDeclHandler | back to summary |
|---|---|
| public DeclHandler getDeclHandler() Return the registered
| |
| getDTDHandler | back to summary |
|---|---|
| public DTDHandler getDTDHandler() Return the registered
| |
| getEntityResolver | back to summary |
|---|---|
| public EntityResolver getEntityResolver() Return the registered
| |
| getErrorHandler | back to summary |
|---|---|
| public ErrorHandler getErrorHandler() Return the registered
| |
| getFeature | back to summary |
|---|---|
| public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException This will look up the value of a SAX feature.
| |
| getFormat | back to summary |
|---|---|
| public Format getFormat() Get the current
| |
| getLexicalHandler | back to summary |
|---|---|
| public LexicalHandler getLexicalHandler() Return the registered
| |
| getLocator | back to summary |
|---|---|
| public JDOMLocator getLocator()
Deprecated there is no way to get a meaningful document Locator outside of an active output process, and the contents of the locator are meaningless outside of an active output process anyway. Returns null.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException This will look up the value of a SAX property.
| |
| getReportDTDEvents | back to summary |
|---|---|
| public boolean getReportDTDEvents() Returns whether DTD events will be reported.
| |
| getReportNamespaceDeclarations | back to summary |
|---|---|
| public boolean getReportNamespaceDeclarations() Returns whether attribute namespace declarations shall be reported as "xmlns" attributes.
| |
| getSAXOutputProcessor | back to summary |
|---|---|
| public SAXOutputProcessor getSAXOutputProcessor() Get the current
| |
| handleError | back to summary |
|---|---|
| private void handleError(JDOMException exception) throws JDOMException
Notifies the registered
| |
| output | back to summary |
|---|---|
| public void output(Document document) throws JDOMException This will output the
| |
| output | back to summary |
|---|---|
| public void output(List<? extends Content> nodes) throws JDOMException This will output a list of JDOM nodes as a document, firing off the SAX events that have been registered. Warning This method may output ill-formed XML documents if the list contains top-level objects that are not legal at the document level (e.g. Text or CDATA nodes, multiple Element nodes, etc.). Thus, it should only be used to output document portions towards ContentHandlers capable of accepting such ill-formed documents (such as XSLT processors).
| |
| output | back to summary |
|---|---|
| public void output(Element node) throws JDOMException This will output a single JDOM element as a document, firing off the SAX events that have been registered.
| |
| outputFragment | back to summary |
|---|---|
| public void outputFragment(List<? extends Content> nodes) throws JDOMException This will output a list of JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered. Warning This method does not call the
| |
| outputFragment | back to summary |
|---|---|
| public void outputFragment(Content node) throws JDOMException This will output a single JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered. Warning This method does not call the
| |
| setContentHandler | back to summary |
|---|---|
| public void setContentHandler(ContentHandler contentHandler) This will set the
| |
| setDeclHandler | back to summary |
|---|---|
| public void setDeclHandler(DeclHandler declHandler) This will set the
| |
| setDTDHandler | back to summary |
|---|---|
| public void setDTDHandler(DTDHandler dtdHandler) This will set the
| |
| setEntityResolver | back to summary |
|---|---|
| public void setEntityResolver(EntityResolver entityResolver) This will set the
| |
| setErrorHandler | back to summary |
|---|---|
| public void setErrorHandler(ErrorHandler errorHandler) This will set the
| |
| setFeature | back to summary |
|---|---|
| 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:
| |
| setFormat | back to summary |
|---|---|
| public void setFormat(Format format) Set the current
| |
| setLexicalHandler | back to summary |
|---|---|
| public void setLexicalHandler(LexicalHandler lexicalHandler) This will set the
| |
| setProperty | back to summary |
|---|---|
| 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:
| |
| setReportDTDEvents | back to summary |
|---|---|
| public void setReportDTDEvents(boolean reportDtdEvents) This will define whether to report DTD events to SAX DeclHandlers and LexicalHandlers if these handlers are registered and the document to output includes a DocType declaration.
| |
| setReportNamespaceDeclarations | back to summary |
|---|---|
| public void setReportNamespaceDeclarations(boolean declareNamespaces) This will define whether attribute namespace declarations shall be
reported as "xmlns" attributes. This flag defaults to
| |
| setSAXOutputProcessor | back to summary |
|---|---|
| public void setSAXOutputProcessor(SAXOutputProcessor processor) Set the current
| |
| Access | Constructor and Description |
|---|---|
| private |
| DefaultSAXOutputProcessor | back to summary |
|---|---|
| private DefaultSAXOutputProcessor() | |