@Deprecated
public abstract class XMLComparator
extends java.lang.Object
An instance of this abstract class can be used to compare two XML trees and produce a delta file containing their differences.
A concrete instance of this class can be obtained using the XMLComparatorFactory.newXMLComparator()
method.
A comparator can be configured using the XMLComparator.setFeature(String, boolean)
and XMLComparator.setProperty(String, Object)
methods.
These control aspects of operation such as the use of a DXMLConstants and the production of a full delta
(where the delta output contains both the differences between the two trees and their similarities). A standard delta file can
be used in conjunction with one of the original files to produce the other original file; however from a full delta either of
the original data files can be produced independently.
The comparator instance can be used to process XML from a variety of sources and write the delta 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:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_FULL_DELTA_DEFAULT_VALUE
Deprecated.
This is a boolean configuration property used to provide the initial or default value for the fullDelta feature setting.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addLicenseFile(java.io.File licenseFile)
Deprecated.
Adds a license file to be used for compare or isEqual operations.
|
abstract void |
addLicenseServer(java.lang.String hostname)
Deprecated.
Adds a license server to be used for concurrent/floating or metered licensing operations.
|
abstract void |
addLicenseServer(java.lang.String hostname,
int portNumber)
Deprecated.
Adds a license server to be used for concurrent/floating or metered licensing operations.
|
abstract void |
compare(javax.xml.transform.Source src1,
javax.xml.transform.Source src2,
javax.xml.transform.Result delta)
Deprecated.
Compare two XML trees and produce a delta tree as result.
|
abstract ErrorListener |
getErrorListener()
Deprecated.
Get the error listener in current use.
|
abstract boolean |
getFeature(java.lang.String name)
Deprecated.
Gets the current value of a feature.
|
abstract java.lang.Object |
getProperty(java.lang.String name)
Deprecated.
Gets the current value of a property.
|
abstract boolean |
isEqual(javax.xml.transform.Source src1,
javax.xml.transform.Source src2)
Deprecated.
Compare two XML trees and return a boolean result indicating whether they have equivalent content.
|
abstract void |
setComparisonHeartbeatListener(ComparisonHeartbeatListener listener)
Deprecated.
Sets a listener which returns an event saying that the comparison is still running at most once a second.
|
abstract void |
setErrorListener(ErrorListener listener)
Deprecated.
Set a listener which is used to report any errors/warnings during the comparison.
|
abstract void |
setFeature(java.lang.String name,
boolean value)
Deprecated.
Sets the (boolean) value of a feature of the XMLComparator.
|
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)
Deprecated.
Sets the value of a property of the XMLComparator.
|
abstract void |
setRedistributionLicenseContent(long[] encodedLicense)
Deprecated.
Sets a redistribution license for use with subsequent compare operations.
|
public static final java.lang.String CONFIG_FULL_DELTA_DEFAULT_VALUE
public abstract void setFeature(java.lang.String name, boolean value) throws XMLComparatorConfigurationException
Sets the (boolean) value of a feature of the XMLComparator.
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.XMLComparatorConfigurationException
- If the feature name is not recognized.XMLComparator.getFeature(String)
,
features and properties documentation for SAX2public abstract boolean getFeature(java.lang.String name) throws XMLComparatorConfigurationException
Gets the current value of a feature.
See the XMLComparator.setFeature(String, boolean)
method description for further documentation.
name
- The feature name; a fully qualified URI.XMLComparatorConfigurationException
- If the feature name is not recognized.XMLComparator.setFeature(String, boolean)
public abstract void setProperty(java.lang.String name, java.lang.Object value) throws XMLComparatorConfigurationException
Sets the value of a property of the XMLComparator.
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.XMLComparatorConfigurationException
- If the property name is not recognized or the value is of the wrong class.XMLComparator.getProperty(String)
,
features and properties documentation for SAX2public abstract java.lang.Object getProperty(java.lang.String name) throws XMLComparatorConfigurationException
Gets the current value of a property.
See the XMLComparator.setProperty(String, Object)
method description for further documentation.
name
- The property name; a fully qualified URI.XMLComparatorConfigurationException
- If the feature name is not recognized or if the value is of the wrong classXMLComparator.setProperty(String, Object)
public abstract void compare(javax.xml.transform.Source src1, javax.xml.transform.Source src2, javax.xml.transform.Result delta) throws DeltaXMLProcessingException
src1
- The first XML tree to comparesrc2
- Another XML tree to compare with the first.delta
- The resulting delta.DeltaXMLProcessingException
- If an unrecoverable error occurs (or is rethrown by an ErrorListener) during the
course of the comparison.public abstract boolean isEqual(javax.xml.transform.Source src1, javax.xml.transform.Source src2) throws DeltaXMLProcessingException
src1
- The first XML tree to comparesrc2
- Another XML tree to compare with the firstDeltaXMLProcessingException
- If an unrecoverable error occurs (or is rethrown by an ErrorListener) during
comparisonpublic abstract void setErrorListener(ErrorListener listener) throws java.lang.IllegalArgumentException
Set a listener which is used to report any errors/warnings during the comparison. This may include errors encountered during SAX processing, file checking and the actual comparison 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
DeltaXML Redistribution or 'OEM' customers should use this method in conjunction with supplied code which is typically compiled and integrated into their own products. The supplied code provides examples of usage. This method is not intended to be used by other types of license/customer.
encodedLicense
- A redistribution licenseLicenseContentException
- if there is a problem processing the content such as a syntax error or license corruptionLicenseSecurityException
- if there are security problems accessing 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 used for compare or isEqual 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 is a problem using the license file@Deprecated public abstract void setLicenseServer(java.lang.String hostname) throws 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 is a problem using the license server@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 is a problem using the license serverpublic abstract void addLicenseFile(java.io.File licenseFile) throws java.lang.SecurityException, java.io.IOException, LicenseContentException
Adds a license file to be used for compare or isEqual 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 is a problem using the license filepublic abstract void addLicenseServer(java.lang.String hostname) throws LicenseContentException
Adds 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 is a problem using the license serverpublic abstract void addLicenseServer(java.lang.String hostname, int portNumber) throws java.lang.IllegalArgumentException, LicenseContentException
Adds 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 is a problem using the license serverpublic abstract void setComparisonHeartbeatListener(ComparisonHeartbeatListener listener)
listener
- the listener to attach to the comparison to receive heartbeat eventsCopyright © 2001-2018 DeltaXML Ltd. All Rights Reserved.