public abstract class XMLCombiner
extends java.lang.Object
An instance of this abstract class can be used to combine an XML tree with a delta tree (as produced by an XMLComparator) to reproduce the other xml tree that formed the other delta input.
A concrete instance of this class can be obtained using the XMLCombinerFactory.newXMLCombiner()
method.
A combiner can be configured using the XMLCombiner.setFeature(String, boolean)
and XMLCombiner.setProperty(String, Object)
methods.
These control aspects of operation such as the use of a DXMLConstants.
The combiner instance can be used to process XML from a variety of sources and write the combined output to a variety of sinks. The use of the TrAX Source and Result interfaces allows the sources and sinks of data to be implemented in various ways. We currently support the SAX and Stream techniques, but not the DOM based methods. More precisely the following are currently supported:
There are some restrictions on the form of delta required by the combiner. Ideally it should be a raw delta produced by the XMLComparator, or the raw pipeline if using the PipelinedComparator. Note the following general restrictions:
Modifier and Type | Method and Description |
---|---|
abstract void |
addLicenseFile(java.io.File licenseFile)
Sets a license file to be use for combine operations.
|
abstract void |
addLicenseServer(java.lang.String hostname)
Sets a license server to be used for concurrent/floating or metered licensing operations.
|
abstract void |
addLicenseServer(java.lang.String hostname,
int portNumber)
Sets a license server to be used for concurrent/floating or metered licensing operations.
|
abstract void |
combine(javax.xml.transform.Source src,
javax.xml.transform.Source delta,
javax.xml.transform.Result result)
Combine an XML tree and a DeltaXML tree and produce the other original XML tree as result.
|
abstract ErrorListener |
getErrorListener()
Get the error listener in current use.
|
abstract boolean |
getFeature(java.lang.String name)
Gets the current value of a feature.
|
abstract java.lang.Object |
getProperty(java.lang.String name)
Gets the current value of a property.
|
abstract void |
setErrorListener(ErrorListener listener)
Set a listener which is used to report any errors/warnings during the combination.
|
abstract void |
setFeature(java.lang.String name,
boolean value)
Sets the (boolean) value of a feature of the XMLCombiner.
|
abstract void |
setLicenseFile(java.io.File licenseFile)
Deprecated.
This method is deprecated in favour of addLicenseFile
|
abstract void |
setLicenseServer(java.lang.String hostname)
Deprecated.
This method is deprecated in favour of addLicenseServer
|
abstract void |
setLicenseServer(java.lang.String hostname,
int portNumber)
Deprecated.
This method is deprecated in favour of addLicenseServer
|
abstract void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets the value of a property of the XMLCombiner.
|
abstract void |
setRedistributionLicenseContent(long[] encodedLicense)
DeltaXML Redistribtion or 'OEM' customers should use this method in conjunction with supplied code which is typically
compiled and integrated into their own products.
|
public abstract void setFeature(java.lang.String name, boolean value) throws XMLCombinerConfigurationException
Sets the (boolean) value of a feature of the XMLCombiner.
This facility is modelled on the features and properties mechanism provided by SAX2.
We also follow the convention of using URIs under our control for the names of features and properties. Thus all features
will use a http://deltaxml.com/api/features
prefix.
See the package overview page for the current list of supported features.
name
- The feature name; a fully qualified URI.value
- The state (true or false) that should be set.XMLCombinerConfigurationException
- If the feature name is not recognized.XMLCombiner.getFeature(String)
,
features and properties documentation for SAX2public abstract boolean getFeature(java.lang.String name) throws XMLCombinerConfigurationException
Gets the current value of a feature.
See the XMLCombiner.setFeature(String, boolean)
method description for further documentation.
name
- The feature name; a fully qualified URI.XMLCombinerConfigurationException
- If the feature name is not recognized.XMLCombiner.setFeature(String, boolean)
public abstract void setProperty(java.lang.String name, java.lang.Object value) throws XMLCombinerConfigurationException
Sets the value of a property of the XMLCombiner.
This facility is modelled on the features and properties mechanism provided by SAX2.
We also follow the convention of using URIs under our control for the names of features and properties. Thus all features
will use a http://deltaxml.com/api/properties
prefix.
See the package overview page for the current list of supported features.
name
- The property name; a fully qualified URI.value
- The value that should be set.XMLCombinerConfigurationException
- If the property name is not recognized or the value is of the wrong class.XMLCombiner.getProperty(String)
,
features and properties documentation for SAX2public abstract java.lang.Object getProperty(java.lang.String name) throws XMLCombinerConfigurationException
Gets the current value of a property.
See the XMLCombiner.setProperty(String, Object)
method description for further documentation.
name
- The property name; a fully qualified URI.XMLCombinerConfigurationException
- If the feature name is not recognized or if the value is of the wrong classXMLCombiner.setProperty(String, Object)
public abstract void combine(javax.xml.transform.Source src, javax.xml.transform.Source delta, javax.xml.transform.Result result) throws DeltaXMLProcessingException
src
- One of the original XML trees used to generate the deltadelta
- A delta tree specifying the differences between two XML treesresult
- The other XML tree generated form the other original file and the deltaDeltaXMLProcessingException
- If an unrecoverable error occurs (or is rethrown by an ErrorListener) during the
course of the combination.public abstract void setErrorListener(ErrorListener listener) throws java.lang.IllegalArgumentException
Set a listener which is used to report any errors/warnings during the combination. This may include errors encountered during SAX processing, file checking and the actual combination process.
If this method is not used an implementation default error listener will be used. This will report error messages to System.err.
listener
- The error listener to be used.java.lang.IllegalArgumentException
- If listener is null.public abstract ErrorListener getErrorListener()
Get the error listener in current use.
public abstract void setRedistributionLicenseContent(long[] encodedLicense) throws LicenseContentException, LicenseSecurityException
encodedLicense
- A redistribtion licenseLicenseContentException
- if there is a problem processing the content such as a syntax error or license corruptionLicenseSecurityException
- if there is a security problem with the license@Deprecated public abstract void setLicenseFile(java.io.File licenseFile) throws java.lang.SecurityException, java.io.IOException, LicenseContentException
Sets a license file to be use for combine operations.
The license file can be an activated or node-locked license and will usually contain a single LICENSE line. Alternatively the license file could include HOST and ISV lines which specify the location of a license server which may be needed for concurrent/floating and metered licensing.
If this method is not used then the licensing code will search for files with a '.lic' extension in the user home directory (the directory returned from calling System.getProperty("user.home")).
licenseFile
- a string providing a path to the license filejava.io.IOException
- if there are any issues reading the filejava.lang.SecurityException
- if there are security issuesLicenseContentException
- if there are licensing file related issues@Deprecated public abstract void setLicenseServer(java.lang.String hostname) throws java.lang.IllegalArgumentException, LicenseContentException
Sets a license server to be used for concurrent/floating or metered licensing operations.
A hostname should either be resolvable through DNS or other forms of lookup, or an IP address could be specified. This method will then connect to the server using the default port of 2700.
hostname
- the hostname or IP address of the license serverLicenseContentException
- if there are problems using the license serverjava.lang.IllegalArgumentException
- if the hostname is null or empty@Deprecated public abstract void setLicenseServer(java.lang.String hostname, int portNumber) throws java.lang.IllegalArgumentException, LicenseContentException
Sets a license server to be used for concurrent/floating or metered licensing operations.
A hostname should either be resolvable through DNS or other forms of lookup, or an IP address could be specified
hostname
- the hostname or IP address of the license serverportNumber
- the port to used connect to the licensing daemonjava.lang.IllegalArgumentException
- if the port number is outside the range 1 to 65535LicenseContentException
- if there are problems using the license serverpublic abstract void addLicenseFile(java.io.File licenseFile) throws java.lang.SecurityException, java.io.IOException, LicenseContentException
Sets a license file to be use for combine operations.
The license file can be an activated or node-locked license and will usually contain a single LICENSE line. Alternatively the license file could include HOST and ISV lines which specify the location of a license server which may be needed for concurrent/floating and metered licensing.
If this method is not used then the licensing code will search for files with a '.lic' extension in the user home directory (the directory returned from calling System.getProperty("user.home")).
licenseFile
- a string providing a path to the license filejava.io.IOException
- if there are any issues reading the filejava.lang.SecurityException
- if there are security issuesLicenseContentException
- if there are licensing file related issuespublic abstract void addLicenseServer(java.lang.String hostname) throws java.lang.IllegalArgumentException, LicenseContentException
Sets a license server to be used for concurrent/floating or metered licensing operations.
A hostname should either be resolvable through DNS or other forms of lookup, or an IP address could be specified. This method will then connect to the server using the default port of 2700.
hostname
- the hostname or IP address of the license serverLicenseContentException
- if there are problems using the license serverjava.lang.IllegalArgumentException
- if the hostname is null or emptypublic abstract void addLicenseServer(java.lang.String hostname, int portNumber) throws java.lang.IllegalArgumentException, LicenseContentException
Sets a license server to be used for concurrent/floating or metered licensing operations.
A hostname should either be resolvable through DNS or other forms of lookup, or an IP address could be specified
hostname
- the hostname or IP address of the license serverportNumber
- the port to used connect to the licensing daemonjava.lang.IllegalArgumentException
- if the port number is outside the range 1 to 65535LicenseContentException
- if there are problems using the license serverCopyright © 2001-2018 DeltaXML Ltd. All Rights Reserved.