public class IlpDataSourceOutput extends Object
Writer
or directly to a SAX
ContentHandler
.
The behavior of this class can be customized by setting properties, such
as the identifier factory, prior to calling one of the output method.IlpDataSource
Constructor and Description |
---|
IlpDataSourceOutput(IlpDataSource dataSource,
ContentHandler contentHandler)
Creates a data source output to output data to an XML document.
|
IlpDataSourceOutput(IlpDataSource dataSource,
Writer writer)
Creates a data source output to output data to an XML document.
|
Modifier and Type | Method and Description |
---|---|
ContentHandler |
getContentHandler()
Returns the
ContentHandler . |
IlpIdentifierFactory |
getIdentifierFactory()
Returns the identifier factory.
|
boolean |
getPrettyPrint()
Returns
true if pretty printing is enabled. |
void |
outputDataSource()
Outputs all the contents of a data source.
|
void |
outputDataSource(IlpFilter filter)
Outputs all the contents of a data source.
|
void |
outputHierarchy(IlpObject ilpObject)
Outputs an object hierarchy.
|
void |
outputHierarchy(IlpObject ilpObject,
IlpFilter filter)
Outputs an object hierarchy.
|
void |
outputObject(IlpObject ilpObject)
Outputs an object.
|
void |
setIdentifierFactory(IlpIdentifierFactory identifierFactory)
Sets the identifier factory to be used when writing data.
|
void |
setPrettyPrint(boolean prettyPrint)
Enables or disables pretty printing.
|
public IlpDataSourceOutput(IlpDataSource dataSource, Writer writer)
dataSource
- The data source. It cannot be null
writer
- The writer to which the data will be written. It cannot be
null
.public IlpDataSourceOutput(IlpDataSource dataSource, ContentHandler contentHandler)
dataSource
- The data source. It cannot be null
contentHandler
- The ContentHandler
to which the data will be written.
It cannot be null
.public ContentHandler getContentHandler()
ContentHandler
.ContentHandler
to which the data
will be written.public void setIdentifierFactory(IlpIdentifierFactory identifierFactory)
By default, it is null
.
identifierFactory
- The identifier factory used to change the identifiers
during writing. It can be null
, which means that the identifiers
do not change.public IlpIdentifierFactory getIdentifierFactory()
public void setPrettyPrint(boolean prettyPrint)
Pretty printing only makes sense when the data source output has been
created using a Writer
. By default, pretty printing is enabled.
prettyPrint
- If this parameter is true
, pretty printing is enabled.public boolean getPrettyPrint()
true
if pretty printing is enabled.public void outputDataSource() throws SAXException
This method is synchronized with the data source.
SAXException
public void outputDataSource(IlpFilter filter) throws SAXException
This method is synchronized with the data source.
filter
- The filter applied to the business objects
present in the data source. A business object
must be accepted by the filter in order to be
present in the output.SAXException
public void outputHierarchy(IlpObject ilpObject) throws SAXException
This method is synchronized with the data source.
SAXException
public void outputHierarchy(IlpObject ilpObject, IlpFilter filter) throws SAXException
This method is synchronized with the data source.
ilpObject
- A business object that has a hierarchy that is present
in the output.filter
- A filter that is applied to the objects that
are part of the hierarchy. Business objects are
only present in the output, if accepted by the
given filter.SAXException
public void outputObject(IlpObject ilpObject) throws SAXException
This method is synchronized with the data source.
SAXException
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.