Class DataComparator
- All Implemented Interfaces:
com.deltaxml.core.internals.CommonComparator
Provides a pre-configured comparison tool more suited for data comparison.
The Data Comparator is a top level component that provides a set of comparison features that are tailored towards data.
The DataComparator includes pre- and post-comparison filters for improving results for many items commonly featured in
XML data.
DataComparator can be configured for comparison in one of two ways;
- Initialise a
DataComparatorusing new and call the setter methods on this class, or - Use a
DTCPConfigurationobject to read a.DTCPconfiguration XML, then callDTCPConfiguration.generate(java.util.Map<java.lang.String, java.lang.Boolean>, java.util.Map<java.lang.String, java.lang.String>)which will return a configuredDataComparatorobject.
Note: A single instance of this class should not be used by multiple threads. Different instances may be used by different threads.
For more information about thread safety please read the Multithreading Guide on our documentation website
- Since:
- 17.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the point at which userFilterSteps can be inserted. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis is a boolean configuration property that when true will send most or all intermediate results to files. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DataComparator.DataComparator(net.sf.saxon.s9api.Processor suppliedProcessor) Creates a new DataComparator. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLicenseFile(File licenseFile) Sets the license file for use with Flexera licensing.voidaddLicenseServer(String hostname) Sets a license server for use with concurrent licensing.voidaddLicenseServer(String hostname, int port) Sets a license server and port for use with concurrent licensing.voidaddProgressListener(com.deltaxml.core.FeatureProgressListener dpl) Add a progress listener to the list of registered progress listeners.voidcancel()Cancel a running comparison from a different thread.voidRemove all currently registered progress listeners.voidCompares File objects and uses a File to represent the result.voidcompare(InputStream a, String systemIdA, InputStream b, String systemIdB, OutputStream result) Compares the XML obtained from InputStream objects and uses an OutputStream to represent the pipeline result.voidCompares the XML obtained from Reader objects and uses a Writer to represent the pipeline result.voidCompares the XML obtained from Strings and uses a StringBuilder to represent the pipeline result.voidCompares the XML obtained from URLs and writes the pipeline result to a File.voidcompare(URL a, URL b, OutputStream result) Compares the XML obtained from URLs and writes the pipeline result to an OutputStream.net.sf.saxon.s9api.XdmNodecompare(net.sf.saxon.s9api.XdmNode a, net.sf.saxon.s9api.XdmNode b) Compares two Saxon XdmNode trees and generates an XdmNode tree result from the pipeline.voidcompare(InputSource a, InputSource b, StreamResult result) Compares the XML obtained from InputSource Objects and writes the pipeline result to a StreamResult.Gets the current Attribute Splitting Configuration setting.booleanGets whether the production of debug files is on or not.Get the current prefix used for debug result files.Gets the current Ignore Changes Configuration setting.Gets the current Move Detection configuration settings.Gets theNamespaceConfigurationsettings in use.intGet the total number of enabled Progress Reporting Stages.getOutputProperty(net.sf.saxon.s9api.Serializer.Property property) Allows the current settings of the serializer properties to be determined.booleangetParserFeature(String featureName) Allows the current settings of parser features to be determined.getParserProperty(String propertyName) Allows the current settings of parser properties to be determined.Returns the current configuration options for result readability.Gets the current Subtree Processing Mode setting.Reports current attribute settings of the XSLT transformers in the pipeline.voidremoveProgressListener(com.deltaxml.core.FeatureProgressListener dpl) Remove a progress listener from the list of registered progress listeners.voidsetAttributeSplittingConfig(AttributeSplittingConfig attributeSplittingConfig) Sets the configuration options for Attribute Splitting.voidsetCancellationPolicy(CancellationPolicy policy, Optional<Long> timeoutMs) Set a policy to timeout the comparison.voidsetDebugFiles(boolean debug) Determines whether intermediate pipeline result files are generated.voidsetDebugFilesPrefix(String debugPrefix) Provide a prefix for debug result files.voidsetExtensionPoint(DataComparator.ExtensionPoint extensionPoint, FilterChain chain) Associates aFilterChainwith the specifiedDataComparator.ExtensionPoint.voidsetGenerateComparisonReport(boolean generateComparisonReport) Turns on or off the generation of an HTML comparison report on completion of a comparison.voidsetIgnoreChangesConfig(IgnoreChangesConfig ignoreChangesConfig) Sets the configuration options for Ignore Changes Processing.voidsetMoveDetectionConfig(MoveDetectionConfig moveDetectionConfig) Sets the configuration options for Move Detection.voidsetNamespaceConfiguration(NamespaceConfiguration namespaceConfiguration) Sets theNamespaceConfigurationsettings to be used.voidsetOutputProperty(net.sf.saxon.s9api.Serializer.Property property, String value) Configures output formatting and control.voidsetParserFeature(String featureName, boolean value) Sets a feature on the parser used for reading XML inputs into a Core S9 Comparator.voidsetParserProperty(String propertyName, Object value) Configures parser properties for the pipeline input parsers.voidsetReportDirectory(String reportDirectory) Set the output directory where a comparison report will be generated.voidSet the configuration options for making a comparison result more readable.voidsetSubtreeProcessingMode(SubtreeProcessingMode subtreeProcessingMode) Sets the configuration options for Subtree Processing.voidsetThreadingConfig(ThreadingConfig threadingConfig) Set the currentThreadingConfiginstance in use by the comparator.voidsetTransformerConfigurationOption(String name, Object value) Set a configuration option on the XSLT transformers used in a Core S9 API comparator.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.deltaxml.core.internals.CommonComparator
addLicenseFile, addLicenseServer, addLicenseServer, compare, compare, compare, compare, compare, compare, compare, compare, getDebugFiles, getDebugFilesPrefix, getNumberOfProgressStages, getOutputProperty, getParserFeature, getParserProperty, getTransformerConfigurationOption, newFilterStepHelper, setDebugFiles, setDebugFilesPrefix, setParserFeature, setParserProperty, setTransformerConfigurationOption
-
Field Details
-
CONFIG_DEBUG_FILES
This is a boolean configuration property that when true will send most or all intermediate results to files. The files are named according to their positions in the respective input and output filter lists. The A and B strings are used to differentiate the input filter chains. If you are using multiple pipelines in a single applications then using a prefix is a good idea.- See Also:
-
CommonComparator.setDebugFiles(boolean)- Constant Field Values
-
-
Constructor Details
-
DataComparator
public DataComparator() throws ParserInstantiationException, FilterClassInstantiationException, FilterConfigurationExceptionCreates a new DataComparator. This will use an internal Saxon
Processorfor running XSLT transformations.- Throws:
ParserInstantiationException- if there is a problem instantiating an XML parserFilterConfigurationException- if any of the Filters used internally by the pipeline cannot be configured correctlyFilterClassInstantiationException- if any of the Java filters used by the pipeline cannot be instantiated
-
DataComparator
public DataComparator(net.sf.saxon.s9api.Processor suppliedProcessor) throws ParserInstantiationException, IllegalArgumentException, FilterConfigurationException, FilterClassInstantiationException Creates a new DataComparator. This will use the supplied Saxon
Processorfor running XSLT transformations.- Parameters:
suppliedProcessor- a SaxonProcessorto be used for the NamePool and filter compilation- Throws:
ParserInstantiationException- if there is a problem instantiating an XML parserIllegalArgumentException- if the suppliedProcessoris from a version of Saxon that is not supported by theDataComparatorFilterConfigurationException- if any of the Filters used internally by the pipeline cannot be configured correctlyFilterClassInstantiationException- if any of the Java filters used by the pipeline cannot be instantiated
-
-
Method Details
-
setOutputProperty
public void setOutputProperty(net.sf.saxon.s9api.Serializer.Property property, String value) throws IllegalArgumentException Configures output formatting and control.
Any properties set here are then passed to the
Serializerused to write the output in most of the compare methods. The compare method which returns an XdmNode result bypasses XML serialization and any properties will have no effect with this method.NOTE The Saxon s9api Serializer will throw an XPathException which in turn will be presented as an exception during compare or isEqual when "omit-xml-declaration" has the value "yes" and standalone has either of the values "yes" or "no". Saxon does however support setting the "standalone" property to "omit" as described in the XSLT2 serialization specification.
Output properties should be set using the
Serializer.Propertyenumeration as follows:DataComparator dtc= new DataComparator(); ... dtc.setOutputProperty(Serializer.Property.INDENT, "yes");
- Specified by:
setOutputPropertyin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
property- the property to setvalue- the new value for the property- Throws:
IllegalArgumentException- if a parameter value is illegal in some way- See Also:
-
Serializer.setOutputProperty(net.sf.saxon.s9api.Serializer.Property, java.lang.String)Serializer.Property- XSLT 2.0 and XQuery 1.0 Serialization, section 5.1.5
-
setSubtreeProcessingMode
Sets the configuration options for Subtree Processing.
- Parameters:
subtreeProcessingMode- aSubtreeProcessingModethat contains the settings to use
-
setExtensionPoint
Associates aFilterChainwith the specifiedDataComparator.ExtensionPoint.This method assigns a filter chain to run at the given extension point during the Data Comparator pipeline execution.
Note: The provided
FilterChainwill automatically have its step name set to theDataComparator.ExtensionPoint's name (viaextensionPoint.toString()).If a chain already exists for the given extension point, it will be replaced. Multiple chains per extension point are supported where applicable (e.g.,
INPUT).- Parameters:
extensionPoint- theDataComparator.ExtensionPointat which to insert the filter chainchain- theFilterChainto be inserted
-
setGenerateComparisonReport
public void setGenerateComparisonReport(boolean generateComparisonReport) Turns on or off the generation of an HTML comparison report on completion of a comparison.
- Parameters:
generateComparisonReport- boolean for comparison report generation. True turns on report generation, false turns off generation.
-
setReportDirectory
Set the output directory where a comparison report will be generated.
- Parameters:
reportDirectory- a String representing the output directory to use when generating comparison report
-
setThreadingConfig
Set the current
ThreadingConfiginstance in use by the comparator.- Parameters:
threadingConfig- theThreadingConfigto set on this comparator.
-
getNamespaceConfiguration
Gets the
NamespaceConfigurationsettings in use.- Returns:
- the current
NamespaceConfigurationinstance that contains namespace settings. - See Also:
-
setNamespaceConfiguration
Sets the
NamespaceConfigurationsettings to be used.- Parameters:
namespaceConfiguration- aNamespaceConfigurationthat contains the settings to use- See Also:
-
getSubtreeProcessingMode
Gets the current Subtree Processing Mode setting.
- Returns:
- the current
SubtreeProcessingModeinstance that contains subtree processing settings.
-
getIgnoreChangesConfig
Gets the current Ignore Changes Configuration setting.
- Returns:
- the current
IgnoreChangesConfiginstance that contains ignore changes settings.
-
setIgnoreChangesConfig
Sets the configuration options for Ignore Changes Processing.
- Parameters:
ignoreChangesConfig- aIgnoreChangesConfigthat contains the settings to use- Throws:
IllegalArgumentException- if passed ignoreChanges XPaths are invalid.
-
getAttributeSplittingConfig
Gets the current Attribute Splitting Configuration setting.
- Returns:
- the current
AttributeSplittingConfiginstance that contains the attribute splitting settings.
-
setAttributeSplittingConfig
Sets the configuration options for Attribute Splitting.
- Parameters:
attributeSplittingConfig- anAttributeSplittingConfigthat contains the settings to use- Throws:
IllegalArgumentException- if passed attributeLocation XPaths are invalid.
-
getMoveDetectionConfig
Gets the current Move Detection configuration settings.
- Returns:
- the current
MoveDetectionConfiginstance that contains move detection settings.
-
setMoveDetectionConfig
Sets the configuration options for Move Detection.
- Parameters:
moveDetectionConfig- aMoveDetectionConfigthat contains the settings to use- Throws:
IllegalArgumentException- if passed attributeXpath is invalid.
-
getResultReadabilityOptions
Returns the current configuration options for result readability.
- Returns:
- a
ResultReadabilityOptionsobjects that contains the current settings
-
setResultReadabilityOptions
Set the configuration options for making a comparison result more readable.
- Parameters:
options- aResultReadabilityOptionsinstance that contains the settings to use
-
getNumberOfProgressStages
public int getNumberOfProgressStages()Get the total number of enabled Progress Reporting Stages. The number returned by this function is dependent on the number of input and output filters that are enabled, so should be called once all these filters have been loaded and configured. It corresponds to the number of Finish messages that will be reported by thePipelineProgressListener.- Specified by:
getNumberOfProgressStagesin interfacecom.deltaxml.core.internals.CommonComparator- Returns:
- the number of enabled stages that the comparison pipeline contains.
-
setDebugFiles
public void setDebugFiles(boolean debug) Determines whether intermediate pipeline result files are generated. When developing a pipelined application it is sometimes useful to see the intermediate results. This debug option when set will generate a file containing the XML corresponding the intermediate result of most of the pipeline stages.
- Specified by:
setDebugFilesin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
debug- when true intermediate result files are produced- See Also:
-
CommonComparator.setDebugFilesPrefix(String)
-
getDebugFiles
public boolean getDebugFiles()Gets whether the production of debug files is on or not.
- Specified by:
getDebugFilesin interfacecom.deltaxml.core.internals.CommonComparator- Returns:
- whether the production of debug files is on or not.
- See Also:
-
CommonComparator.setDebugFilesPrefix(String)
-
setDebugFilesPrefix
Provide a prefix for debug result files.- Specified by:
setDebugFilesPrefixin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
debugPrefix- The prefix that will be used for debug file names in subsequent compare operations- See Also:
-
CommonComparator.setDebugFiles(boolean)
-
getDebugFilesPrefix
Get the current prefix used for debug result files.- Specified by:
getDebugFilesPrefixin interfacecom.deltaxml.core.internals.CommonComparator- Returns:
- the current prefix used for debug result files.
- See Also:
-
CommonComparator.setDebugFiles(boolean)
-
clearProgressListeners
public void clearProgressListeners()Remove all currently registered progress listeners. -
addProgressListener
public void addProgressListener(com.deltaxml.core.FeatureProgressListener dpl) Add a progress listener to the list of registered progress listeners. It is possible to add the same listener multiple times.- Parameters:
dpl- the progress listener to register.
-
removeProgressListener
public void removeProgressListener(com.deltaxml.core.FeatureProgressListener dpl) Remove a progress listener from the list of registered progress listeners. This will remove the first occurrence of a progress listener.- Parameters:
dpl- the progress listener to remove.
-
setCancellationPolicy
Set a policy to timeout the comparison.- Parameters:
timeoutMs- An Optional timeout for use when policy isCancellationPolicy.Timed. The default is 5 minutespolicy- The policy which dictates how the timeout will work. The default isCancellationPolicy.Noop- See Also:
-
cancel
public void cancel()Cancel a running comparison from a different thread. -
newFilterStepHelper
Description copied from interface:com.deltaxml.core.internals.CommonComparatorCreates a
FilterStepHelperusing theProcessorandURIResolvercurrently in use by this comparator.Due to the way that Saxon's Processor works, all internal XdmNodes and compiled XSLT must be created by the same
Processor. ThereforeFilterChains andFilterSteps that are to be associated with this Comparator should be instantiated by this Comparator'sFilterStepHelper, which is what this method provides.- Specified by:
newFilterStepHelperin interfacecom.deltaxml.core.internals.CommonComparator- Returns:
- an instance of a
FilterStepHelperwith which to createFilterChains andFilterSteps for this Core S9 API Comparator.
-
getParserFeature
public boolean getParserFeature(String featureName) throws FeatureNotRecognizedException, IllegalArgumentException Description copied from interface:com.deltaxml.core.internals.CommonComparatorAllows the current settings of parser features to be determined.- Specified by:
getParserFeaturein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
featureName- the name of the feature whose value is being queried- Returns:
- the current value of the feature
- Throws:
FeatureNotRecognizedException- if the featureName is not recognizedIllegalArgumentException- if the argument is null- See Also:
-
CommonComparator.setParserFeature(String, boolean)
-
setParserFeature
public void setParserFeature(String featureName, boolean value) throws FeatureSettingNotSupportedException, FeatureNotRecognizedException, IllegalArgumentException Description copied from interface:com.deltaxml.core.internals.CommonComparatorSets a feature on the parser used for reading XML inputs into a Core S9 Comparator.
Feature setting modify the parsing behaviour of a pipeline. In particular features relating to input validation, schema and DTD handling can be controlled. The features which can be controlled are features of the underlying SAX parser used in the pipeline (but with some exceptions described below). If the SAX parser being used is Apache Xerces, the features which can be set are both the generic SAX features and Apache specific ones.
These features are only appropriate and will only be applied when the compare methods in this class are responsible for parsing and loading input XML data. When the compare or isEqual methods use XdmNode arguments the data has already been parsed and the code being used for creating the XdmNode objects should be configured appropriately.
The following table lists settings which should not be used, as the Saxon s9api code used internally in the PipelinedComparator will override these settings. Alternative settings using the
CommonComparator.setTransformerConfigurationOption(java.lang.String, java.lang.Object)method must be used instead:Settings that must not be used. Parser Feature Corresponding setTransformerConfigurationOption http://xml.org/sax/features/validation Feature.DTD_VALIDATIONhttp://apache.org/xml/features/xinclude-aware Feature.XINCLUDEhttp://apache.org/xml/features/xinclude Feature.XINCLUDEThe following list includes some of the features which we consider useful in conjunction with a pipelined comparator architecture:
- http://apache.org/xml/features/validation/ dynamic
- http://apache.org/xml/features/validation/ schema
- http://apache.org/xml/features/ nonvalidating/load-dtd-grammar
- http://apache.org/xml/features/ nonvalidating/load-external-dtd
The following table lists features that can only be set to specific values. These fixed settings are necessary for the comparator to operate properly. This in turn is because Saxon requires particular feature settings to be used and supported by setFeature. Any attempt to set values other than those shown below will result in a
FeatureSettingNotSupportedExceptionbeing thrown.Settings that are restricted. Feature fixed/permissible value http://xml.org/sax/features/namespaces true http://xml.org/sax/features/namespace- prefixes false - Specified by:
setParserFeaturein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
featureName- the name of the feature to be setvalue- the new value for the feature- Throws:
FeatureSettingNotSupportedException- if the feature cannot be set to the specific valueFeatureNotRecognizedException- if the featureName is not recognizedIllegalArgumentException- if the featureName argument is null- See Also:
-
XMLReader.setFeature(String, boolean)Processor.setConfigurationProperty(Feature, Object)Feature
-
getParserProperty
public Object getParserProperty(String propertyName) throws PropertyNotRecognizedException, IllegalArgumentException Description copied from interface:com.deltaxml.core.internals.CommonComparatorAllows the current settings of parser properties to be determined.- Specified by:
getParserPropertyin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
propertyName- the name of the property whose value is being queried- Returns:
- an Object representing the current value of the property
- Throws:
PropertyNotRecognizedException- if the property name is not recognizedIllegalArgumentException- if the argument is null- See Also:
-
CommonComparator.setParserProperty(String, Object)
-
setParserProperty
public void setParserProperty(String propertyName, Object value) throws PropertyNotRecognizedException, PropertySettingNotSupportedException, IllegalArgumentException Description copied from interface:com.deltaxml.core.internals.CommonComparatorConfigures parser properties for the pipeline input parsers.
Allows properties of the underlying parser to be configured. If using Apache Xerces-J the following properties may prove useful in comparator pipelines:
- Specified by:
setParserPropertyin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
propertyName- the name of the property to set on the parservalue- the new value for the property- Throws:
PropertyNotRecognizedException- if the property name is not recognizedPropertySettingNotSupportedException- if the property cannot be set to the specific valueIllegalArgumentException- if an argument is null- See Also:
-
CommonComparator.getParserProperty(String)XMLReader.setProperty(java.lang.String, java.lang.Object)
-
getOutputProperty
Description copied from interface:com.deltaxml.core.internals.CommonComparatorAllows the current settings of the serializer properties to be determined.- Specified by:
getOutputPropertyin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
property- the output property whose value is being queried- Returns:
- the value of the property
- See Also:
-
Serializer.Property
-
getTransformerConfigurationOption
Description copied from interface:com.deltaxml.core.internals.CommonComparatorReports current attribute settings of the XSLT transformers in the pipeline.- Specified by:
getTransformerConfigurationOptionin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
name- of the option to report- Returns:
- an Object representing the current setting
- Throws:
IllegalArgumentException- if the attribute name is not recognized by the underlying TransformerFactory- See Also:
-
- Saxon Feature
- Xalan-J attributes
CommonComparator.setTransformerConfigurationOption(String, Object)
-
setTransformerConfigurationOption
public void setTransformerConfigurationOption(String name, Object value) throws IllegalArgumentException Description copied from interface:com.deltaxml.core.internals.CommonComparatorSet a configuration option on the XSLT transformers used in a Core S9 API comparator. Some of the configuration options affect the compilation of XSLT filters and as the compilation process can be triggered by various step helper methods. This method should be used prior to these methods if appropriate. Please also note that it is possible to create XSLT based steps using a Saxon Processor argument, this method will not apply to Steps created in this way as this method configures the Saxon Processor that is created by or passed as an argument to a Core S9 API comparator constructor.
Please note: Some of the options available with Saxon assume that the Transformer is 'in control' of the parser or XMLReader used for input processing. This is not the case for Core S9 API comparators; if an attribute seems to have no effect look for alternative techniques such as using equivalent features and the
CommonComparator.setParserFeature(java.lang.String, boolean)method.- Specified by:
setTransformerConfigurationOptionin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
name- The name of the option to setvalue- The value to be set (an Object)- Throws:
IllegalArgumentException- if the attribute name is not recognized by the underlying Transformer- See Also:
-
- Saxon Feature
CommonComparator.getTransformerConfigurationOption(String)CommonComparator.setParserFeature(String, boolean)
-
compare
public void compare(File f1, File f2, File result) throws ComparisonException, FilterProcessingException, IOException, PipelineLoadingException, PipelineSerializationException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares File objects and uses a File to represent the result.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
f1- the first comparison inputf2- the second inputresult- the location where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingFilterProcessingException- if there was a problem running any of the filtersFileNotFoundException- if the input or output files cannot be foundIOException- if there is a problem opening/closing streams associated with the File argumentsPipelineLoadingException- if the inputs cannot be loaded or parsedPipelineSerializationException- if the result cannot be saved or serialized to the result locationcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(Reader a, String systemIdA, Reader b, String systemIdB, Writer result) throws ComparisonException, FilterProcessingException, PipelineLoadingException, PipelineSerializationException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from Reader objects and uses a Writer to represent the pipeline result.
systemId parameters are provided so that relative URIs can be resolved in the inputs, they are also useful when reporting errors as the systemId may be useful when locating the error position. Using identifiers such as "string1" or "database2" may be useful when the inputs do not contain URIs to resolve as they can aid error diagnosis.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The reader from which the first input is readsystemIdA- the SystemId used for resolving URIs and reporting errors associated with the A inputb- The reader for the second inputsystemIdB- the SystemId used for resolving URIs and reporting errors associated with the B inputresult- where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingFilterProcessingException- if there was a problem running any of the filtersPipelineLoadingException- if the inputs cannot be loaded or parsedPipelineSerializationException- if the output cannot be saved or serialized to the result locationcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(InputStream a, String systemIdA, InputStream b, String systemIdB, OutputStream result) throws ComparisonException, PipelineLoadingException, FilterProcessingException, PipelineSerializationException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from InputStream objects and uses an OutputStream to represent the pipeline result.
systemId parameters are provided so that relative URIs can be resolved in the inputs, they are also useful when reporting errors as the systemId may be useful when locating the error position. Using identifiers such as "string1" or "database2" may be useful when the inputs do not contain URIs to resolve as they can aid error diagnosis.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The InputStream from which the first input is readsystemIdA- the SystemId used for resolving URIs and reporting errors associated with the A inputb- The InputStream for the second inputsystemIdB- the SystemId used for resolving URIs and reporting errors associated with the B inputresult- where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingPipelineLoadingException- if the inputs cannot be loaded or parsedFilterProcessingException- if there was a problem running any of the filtersPipelineSerializationException- if the output cannot be saved or serialized to the result locationcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(String a, String systemIdA, String b, String systemIdB, StringBuilder result) throws ComparisonException, PipelineLoadingException, FilterProcessingException, PipelineSerializationException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from Strings and uses a StringBuilder to represent the pipeline result.
systemId parameters are provided so that relative URIs can be resolved in the inputs, they are also useful when reporting errors as the systemId may be useful when locating the error position. Using identifiers such as "string1" or "database2" may be useful when the inputs do not contain URIs to resolve as they can aid error diagnosis.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The String from which the first input is readsystemIdA- the SystemId used for resolving URIs and reporting errors associated with the A inputb- The String for the second inputsystemIdB- the SystemId used for resolving URIs and reporting errors associated with the B inputresult- where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingPipelineLoadingException- if the inputs cannot be loaded or parsedFilterProcessingException- if there was a problem running any of the filtersPipelineSerializationException- if the output cannot be saved or serialized to the result locationcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(URL a, URL b, File result) throws ComparisonException, PipelineLoadingException, FilterProcessingException, PipelineSerializationException, FileNotFoundException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from URLs and writes the pipeline result to a File.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The URL from which the first input is loadedb- The URL for the second inputresult- where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingPipelineLoadingException- if the inputs cannot be loaded or parsedFilterProcessingException- if there was a problem running any of the filtersPipelineSerializationException- if the output cannot be saved or serialized to the result locationFileNotFoundException- if the output file location cannot be foundcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(URL a, URL b, OutputStream result) throws ComparisonException, PipelineLoadingException, FilterProcessingException, PipelineSerializationException, com.deltaxml.licensing.LicenseException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from URLs and writes the pipeline result to an OutputStream.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The URL from which the first input is loadedb- The URL for the second inputresult- where the pipeline result will be written- Throws:
ComparisonException- if there is a problem during the comparison processingPipelineLoadingException- if the inputs cannot be loaded or parsedFilterProcessingException- if there was a problem running any of the filtersPipelineSerializationException- if the input cannot be saved or serialized to the result locationcom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
compare
public void compare(InputSource a, InputSource b, StreamResult result) throws ComparisonException, PipelineLoadingException, FilterProcessingException, PipelineSerializationException, ComparisonCancelledException, com.deltaxml.licensing.LicenseException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares the XML obtained from InputSource Objects and writes the pipeline result to a StreamResult.
It is recommended that systemIds be associated with the InputSource parameters so that relative URIs and external entities can be resolved.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The InputSource from which the first input is loadedb- The InputSource for the second inputresult- where the pipeline result will be written- Throws:
ComparisonException- if their is a problem during the comparison stage of the pipelinePipelineLoadingException- if the inputs cannot be loaded or parsedFilterProcessingException- if there was a problem running any of the filtersPipelineSerializationException- if the output cannot be saved or serialized to the result locationComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin forcecom.deltaxml.licensing.LicenseException- if there is a licensing issue that prevents operation
-
compare
public net.sf.saxon.s9api.XdmNode compare(net.sf.saxon.s9api.XdmNode a, net.sf.saxon.s9api.XdmNode b) throws FilterProcessingException, ComparisonException, com.deltaxml.licensing.LicenseException, IllegalArgumentException, ComparisonCancelledException Description copied from interface:com.deltaxml.core.internals.CommonComparatorCompares two Saxon XdmNode trees and generates an XdmNode tree result from the pipeline.
XdmNode trees are associated with specific s9api Processors. This method should be used in conjunction with one of the class constructors which takes a Processor argument.
- Specified by:
comparein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
a- The first XdmNode input tree to be comparedb- The second XdmNode input- Returns:
- an XdmNode tree containing the comparison result
- Throws:
FilterProcessingException- if there is a problem executing the pipeline filtersComparisonException- if there is a problem during the comparison processingcom.deltaxml.licensing.LicenseException- if there is a licensing issueIllegalArgumentException- if the XdmNodes were produced by an unknown Saxon ProcessorComparisonCancelledException- if a comparison is cancelled according to theCancellationPolicyin force
-
addLicenseFile
public void addLicenseFile(File licenseFile) throws SecurityException, IOException, com.deltaxml.licensing.LicenseException Description copied from interface:com.deltaxml.core.internals.CommonComparatorSets the license file for use with Flexera licensing. This can be either simple fixed host/user licensing, or a concurrent licensing containing the USE_SERVER directive- Specified by:
addLicenseFilein interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
licenseFile- the FlexLM format license file- Throws:
SecurityException- if the file cannot be accessedIOException- if there are problems reading the filecom.deltaxml.licensing.LicenseException- if there is a problem using the license file
-
addLicenseServer
Description copied from interface:com.deltaxml.core.internals.CommonComparatorSets a license server for use with concurrent licensing.- Specified by:
addLicenseServerin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
hostname- the license server host or its ip address- Throws:
com.deltaxml.licensing.LicenseException- if there is a problem using the license server
-
addLicenseServer
public void addLicenseServer(String hostname, int port) throws IllegalArgumentException, com.deltaxml.licensing.LicenseException Description copied from interface:com.deltaxml.core.internals.CommonComparatorSets a license server and port for use with concurrent licensing.- Specified by:
addLicenseServerin interfacecom.deltaxml.core.internals.CommonComparator- Parameters:
hostname- the license server host or its ip addressport- the port number on the license server for the lmgrd- Throws:
IllegalArgumentException- if the port number is out of rangecom.deltaxml.licensing.LicenseException- if there is a problem using the license server
-