ilog.cpl.storage
Class IlpDataSourceOutput

java.lang.Object
  extended by ilog.cpl.storage.IlpDataSourceOutput

public class IlpDataSourceOutput
extends Object

This class writes all or part of the contents of a data source as an XML document. This XML document can be written to a 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.

Since:
JTGO 3.0
See Also:
IlpDataSource

Constructor Summary
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.
 
Method Summary
 ContentHandler getContentHandler()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpDataSourceOutput

public IlpDataSourceOutput(IlpDataSource dataSource,
                           Writer writer)
Creates a data source output to output data to an XML document.

Parameters:
dataSource - The data source. It cannot be null
writer - The writer to which the data will be written. It cannot be null.

IlpDataSourceOutput

public IlpDataSourceOutput(IlpDataSource dataSource,
                           ContentHandler contentHandler)
Creates a data source output to output data to an XML document.

Parameters:
dataSource - The data source. It cannot be null
contentHandler - The ContentHandler to which the data will be written. It cannot be null.
Method Detail

getContentHandler

public ContentHandler getContentHandler()
Returns:
The ContentHandler to which the data will be written.

setIdentifierFactory

public void setIdentifierFactory(IlpIdentifierFactory identifierFactory)
Sets the identifier factory to be used when writing data.

By default, it is null.

Parameters:
identifierFactory - The identifier factory used to change the identifiers during writing. It can be null, which means that the identifiers do not change.

getIdentifierFactory

public IlpIdentifierFactory getIdentifierFactory()
Returns the identifier factory.

See Also:
setIdentifierFactory(IlpIdentifierFactory)

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)
Enables or disables pretty printing.

Pretty printing only makes sense when the data source output has been created using a Writer. By default, pretty printing is enabled.

Parameters:
prettyPrint - If this parameter is true, pretty printing is enabled.

getPrettyPrint

public boolean getPrettyPrint()
Returns true if pretty printing is enabled.


outputDataSource

public void outputDataSource()
                      throws SAXException
Outputs all the contents of a data source.

This method is synchronized with the data source.

Throws:
SAXException

outputDataSource

public void outputDataSource(IlpFilter filter)
                      throws SAXException
Outputs all the contents of a data source.

This method is synchronized with the data source.

Parameters:
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.
Throws:
SAXException
Since:
JTGO 4.0

outputHierarchy

public void outputHierarchy(IlpObject ilpObject)
                     throws SAXException
Outputs an object hierarchy.

This method is synchronized with the data source.

Throws:
SAXException

outputHierarchy

public void outputHierarchy(IlpObject ilpObject,
                            IlpFilter filter)
                     throws SAXException
Outputs an object hierarchy.

This method is synchronized with the data source.

Parameters:
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.
Throws:
SAXException
Since:
JTGO 4.0

outputObject

public void outputObject(IlpObject ilpObject)
                  throws SAXException
Outputs an object.

This method is synchronized with the data source.

Throws:
SAXException


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.