public class PipelinedComparator
extends java.lang.Object
Provides a Pipeline abstraction for the Comparator.
Each of the two comparator input streams is passed through a number of input filters and the comparator output is fed through a chain of output filters. Filters can be used for input processing or cleaning (removing unnecessary whitespace or elements not significant for comparison), keying, or output report generation. They could be implemented using XSLT or Java. The current implementation also supports filter parameterization using String parameters.
Note: This class instantiates the underlying pipeline components including SAX parsers and XSLT transformers using the JAXP factory mechanisms. Reconfiguring the factories so as to change the underlying factory implementation classes during the existence of a PipelinedComparator is not supported and may result in unpredictable results.
Note: A single instance of this class should not be used by multiple threads. Different instances may be used by different threads.
Note: A limitation in Saxon versions 9.x prevents a TransformerHandler being reused. When it is reused an UnsupportedOperationException with an exception message stating that a 'TransformerHandler is not serially reusable' is thrown. In PipelinedComparator this situation corresponds to the use of an XSLT output filter and multiple invocations of compare or isEqual methods. Using the new cores9api package will avoid this problem as will using Saxon version 6.5.5 when using solely XSLT 1.0 filters. Alternatively the calling the setOutputFilters method before each compare or isEqual method is called provides a work-around.
Constructor and Description |
---|
PipelinedComparator()
Creates a new instance of PipelinedComparator
|
PipelinedComparator(boolean bypassJAXPFactories)
Creates a new instance of PipelinedComparator
|
Modifier and Type | Method and Description |
---|---|
void |
compare(java.io.File f1,
java.io.File f2,
java.io.File result)
Compares two File inputs and writes the result to a File.
|
void |
compare(java.io.InputStream is1,
java.io.InputStream is2,
java.io.OutputStream result)
Compares two InputStream inputs and writes the result to an OutputStream.
|
void |
compare(java.io.Reader r1,
java.io.Reader r2,
java.io.Writer result)
Compares two Reader inputs and writes the result to a Writer.
|
void |
compare(javax.xml.transform.Source s1,
javax.xml.transform.Source s2,
javax.xml.transform.Result r)
Compares two Source inputs and writes the result to a Result.
|
void |
compare(java.lang.String s1,
java.lang.String s2,
java.lang.StringBuffer result)
Compares two String inputs and writes the result to a StringBuffer.
|
void |
compare(java.net.URL u1,
java.net.URL u2,
java.io.File result)
Compares two URL inputs and writes the result to a File.
|
void |
compare(java.net.URL u1,
java.net.URL u2,
java.net.URL result)
Compares two URL inputs and writes the result to a URL.
|
boolean |
getComparatorFeature(java.lang.String name)
Allows the current settings of comparator features to be determined.
|
java.lang.Object |
getComparatorProperty(java.lang.String name)
Allows the current settings of the comparator properties to be determined.
|
java.lang.String |
getOutputProperty(java.lang.String name)
Allows the current settings of the output properties to be determined.
|
boolean |
getParserFeature(java.lang.String featureName)
Allows the current settings of parser features to be determined.
|
java.lang.Object |
getParserProperty(java.lang.String name)
Allows the current settings of parser properties to be determined.
|
java.lang.Object |
getTransformerAttribute(java.lang.String name)
Reports current attribute settings of the underlying TransformerFactory used to create XSLT based filters in the pipeline.
|
javax.xml.transform.URIResolver |
getURIResolver()
Returns the current URIResolver in use.
|
boolean |
isEqual(java.io.File f1,
java.io.File f2)
Compares two File inputs and returns whether they're equal.
|
boolean |
isEqual(java.io.InputStream is1,
java.io.InputStream is2)
Compares two InputStream inputs and returns whether they're equal.
|
boolean |
isEqual(java.io.Reader r1,
java.io.Reader r2)
Compares two Reader inputs and returns whether they're equal.
|
boolean |
isEqual(javax.xml.transform.Source s1,
javax.xml.transform.Source s2)
Compares two Source inputs and returns whether they're equal.
|
boolean |
isEqual(java.lang.String s1,
java.lang.String s2)
Compares two String inputs and returns whether they're equal.
|
boolean |
isEqual(java.net.URL u1,
java.net.URL u2)
Compares two URL inputs and returns whether they're equal.
|
void |
setComparatorFeature(java.lang.String name,
boolean value)
Sets a Feature (or option) associated with the comparator at the centre of the pipeline.
|
void |
setComparatorProperty(java.lang.String name,
java.lang.Object value)
Configures comparator properties for the pipeline.
|
void |
setInput1Filters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters)
Allows SAX event filters to be specified in terms of classes which implement the XMLFilter interface.
|
void |
setInput1Filters(java.io.File[] filters)
Allows SAX event filters to be specified in terms of File objects that reference XSL filters.
|
void |
setInput1Filters(java.util.List<?> filters)
Allows SAX event filters to be specified in a mixed List of any of the valid object types: Class, File, URL, Templates or
ParameterizedFilter.
|
void |
setInput1Filters(ParameterizedFilter[] filters)
Allows SAX event filters to be specified in terms of ParameterizedFilter objects..
|
void |
setInput1Filters(javax.xml.transform.Templates[] filters)
Allows SAX event filters to be specified in terms of Templates objects.
|
void |
setInput1Filters(java.net.URL[] filters)
Allows SAX event filters to be specified in terms of URL pointers that reference XSL filters.
|
void |
setInput2Filters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters)
Allows SAX event filters to be specified in terms of classes which implement the XMLFilter interface.
|
void |
setInput2Filters(java.io.File[] filters)
Allows SAX event filters to be specified in terms of File objects that reference XSL filters.
|
void |
setInput2Filters(java.util.List<?> filters)
Allows SAX event filters to be specified in a mixed List of any of the valid object types: Class, File, URL, Templates or
ParameterizedFilter.
|
void |
setInput2Filters(ParameterizedFilter[] filters)
Allows SAX event filters to be specified in terms of ParameterizedFilter objects..
|
void |
setInput2Filters(javax.xml.transform.Templates[] filters)
Allows SAX event filters to be specified in terms of Templates objects.
|
void |
setInput2Filters(java.net.URL[] filters)
Allows SAX event filters to be specified in terms of URL pointers that reference XSL filters.
|
void |
setInputFilters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters)
Allows SAX event filters to be specified in terms of classes which implement the XMLFilter interface.
|
void |
setInputFilters(java.io.File[] filters)
Allows SAX event filters to be specified in terms of File objects that reference XSL filters.
|
void |
setInputFilters(java.util.List<?> filters)
Allows SAX event filters to be specified in a mixed List of any of the valid object types: Class, File, URL, Templates or
ParameterizedFilter.
|
void |
setInputFilters(ParameterizedFilter[] filters)
Allows SAX event filters to be specified in terms of ParameterizedFilter objects.
|
void |
setInputFilters(javax.xml.transform.Templates[] filters)
Allows SAX event filters to be specified in terms of Templates objects.
|
void |
setInputFilters(java.net.URL[] filters)
Allows SAX event filters to be specified in terms of URL pointers that reference XSL filters.
|
void |
setOutputFilters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters)
Allows SAX event filters to be specified in terms of classes.
|
void |
setOutputFilters(java.io.File[] filters)
Allows SAX event filters to be specified in terms of File objects that reference XSL filters.
|
void |
setOutputFilters(java.util.List<?> filters)
Allows SAX event filters to be specified in a mixed List of any of the valid object types: Class, File, URL, Templates or
ParameterizedFilter.
|
void |
setOutputFilters(ParameterizedFilter[] filters)
Allows SAX event filters to be specified in terms of ParameterizedFilter objects.
|
void |
setOutputFilters(javax.xml.transform.Templates[] templates)
Allows SAX event filters to be specified in terms of Templates objects.
|
void |
setOutputFilters(java.net.URL[] filters)
Allows SAX event filters to be specified in terms of URL pointers that reference XSL filters.
|
void |
setOutputProperty(java.lang.String name,
java.lang.String value)
Configures output formatting and control.
|
void |
setParserFeature(java.lang.String featureName,
boolean value)
Modifies the parsing behaviour of a pipeline.
|
void |
setParserProperty(java.lang.String name,
java.lang.Object value)
Configures parser properties for the pipeline input parsers.
|
void |
setRedistributionLicenseContent(long[] encodedLicense)
Sets a redistribution license for use with subsequent compare and isEqual operations.
|
void |
setTransformerAttribute(java.lang.String name,
java.lang.Object value)
Sets an attribute used by the TransformerFactory used to create XSLT based filters in the pipeline.
|
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Sets a resolver for use by all XSLT based input and output filters in the pipeline.
|
void |
setURIResolver(javax.xml.transform.URIResolver resolver,
boolean useFallbackURIResolver)
Specifies the URIResolver to be used with the generated PipelinedComparator and also when converting DXP resources into
Template objects.
|
public PipelinedComparator() throws ParserInstantiationException, TransformerInstantiationException
Creates a new instance of PipelinedComparator
This constructor uses the standard JAXP Factory mechanisms to locate an XSLT transformer and SAX Parser.
ParserInstantiationException
- when there are issues creating an underlying XMLReader
TransformerInstantiationException
- when there are issues creating an underlying Transformer
public PipelinedComparator(boolean bypassJAXPFactories) throws ParserInstantiationException, TransformerInstantiationException
Creates a new instance of PipelinedComparator
This constructor allows the JAXP factory mechanisms to be bypassed. While not normally recommended for general use, this
feature may be useful in certain application server contexts where the default loader delegation order ('parent first') will
often return an XSLT processor or SAX Parser used by the application server generally and not that included with the jar
files of a specific application or servlet. Rather than using the JAXP factory newInstance()
method the
corresponding factory implementation class is instantiated through reflection. These classes are
net.sf.saxon.TransformerFactoryImpl
and org.apache.xerces.jaxp.SAXParserFactoryImpl
for the XSLT
Transformer and SAX Parser respectively. The reflection code will attempt to use both the 'context classloader' and the
'current classloader', so for example the following effective methods would be used to locate Saxon:
Class.forName("net.sf.saxon.TransformerFactoryImpl", true, Thread.currentThread().getContextClassLoader());
Class.forName("net.sf.saxon.TransformerFactoryImpl", true, this.getClass().getClassLoader());
The context classloader is tried first and then the current classloader. If the class is not found or if any other error
occurs (see the Javadoc for Class.forName()) then the code will throw a TransformerInstantiationException
.
Please note: the bypass mechanism instantiates Xerces-J using the 'org.apache.jaxp.SAXParserFactoryImpl' classname. This may
not be the same classname as used by the version of xerces often included in the Java runtime. However, it does correspond to
the class found in xercesImpl.jar
included with the DeltaXML release and the separate Xerces-J downloads.
bypassJAXPFactories
- when true directly instantiates Saxon and Xerces rather than using JAXP Factory mechanismsParserInstantiationException
- when there are issues creating an underlying XMLReader
TransformerInstantiationException
- when there are issues creating an underlying Transformer
Class.forName(String, boolean, ClassLoader)
public void setURIResolver(javax.xml.transform.URIResolver resolver, boolean useFallbackURIResolver)
<xsl:import>
, <xsl:include>
and document()
. The fallback URI resolver supports the internal use of
encrypted XSLT filters.resolver
- An implementation of the URIResolver interface, or nulluseFallbackURIResolver
- Whether to use the fallback URI Resolver, if the user supplied URI Resolver fails to resolve.TransformerFactory.setURIResolver(URIResolver)
,
Transformer.setURIResolver(URIResolver)
public void setURIResolver(javax.xml.transform.URIResolver resolver)
<xsl:import>
,
<xml:include>
and document()
constructs This is equivalent to calling
setURIResolver(resolver, true)
.resolver
- An implementation of the URIResolver interface, or nullTransformerFactory.setURIResolver(URIResolver)
,
Transformer.setURIResolver(URIResolver)
public javax.xml.transform.URIResolver getURIResolver()
TransformerFactory.getURIResolver()
public void setTransformerAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
Sets an attribute used by the TransformerFactory used to create XSLT based filters in the pipeline. Attributes are implementation specific. For details of the attributes supported by the Saxon and Xalan-J processors see the javadoc links below.
Please note: Some of the Attributes available with Saxon assume that the Transformer is 'in control' of the
parser or XMLReader used for input processing. In a PipelinedComparator this is not the case (internally SAXSource inputs are
supplied to Transformers); if an attribute seems to have no effect look for alternative techniques such as using equivalent
features and the PipelinedComparator.setParserFeature(java.lang.String, boolean)
method.
name
- The name of the attribute to setvalue
- The value to be set (an Object)java.lang.IllegalArgumentException
- if the attribute name is not recognized by the underlying TransformerFactoryPipelinedComparator.getTransformerAttribute(String)
,
PipelinedComparator.setParserFeature(String, boolean)
public java.lang.Object getTransformerAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
name
- of the attribute to reportjava.lang.IllegalArgumentException
- if the attribute name is not recognized by the underlying TransformerFactoryPipelinedComparator.setTransformerAttribute(String, Object)
public void setParserFeature(java.lang.String featureName, boolean value) throws FeatureSettingNotSupportedException, FeatureNotRecognizedException, java.lang.IllegalArgumentException
Modifies 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. 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 StreamSource input is provided to the pipeline. When SAXSource or other forms of Source are provided the input has already been parsed.
The following list includes some of the features which we consider useful in conjunction with a pipelined comparator architecture:
The following table lists features that can only be set to specific values. These fixed settings are necessary for this pipelined architecture to operate properly. This is because by default it uses Saxon which 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 FeatureSettingNotSupportedException being thrown.
Feature | fixed/permissible value |
---|---|
http://xml.org/sax/features/namespaces | true |
http://xml.org/sax/features/namespace- prefixes | false |
featureName
- the name of the feature to be setvalue
- the new value for the featureFeatureSettingNotSupportedException
- if the feature cannot be set to the specific valueFeatureNotRecognizedException
- if the featureName is not recognizedjava.lang.IllegalArgumentException
- if the argument is nullXMLReader.setFeature(String, boolean)
public boolean getParserFeature(java.lang.String featureName) throws FeatureNotRecognizedException, java.lang.IllegalArgumentException
featureName
- the name of the feature whose value is being queriedFeatureNotRecognizedException
- if the featureName is not recognizedjava.lang.IllegalArgumentException
- if the argument is nullPipelinedComparator.setParserFeature(String, boolean)
public void setParserProperty(java.lang.String name, java.lang.Object value) throws PropertyNotRecognizedException, PropertySettingNotSupportedException, java.lang.IllegalArgumentException
Configures 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:
name
- the name of the property to setvalue
- the new value for the propertyPropertySettingNotSupportedException
- if the property cannot be set to the specific valuePropertyNotRecognizedException
- if the property name is not recognizedjava.lang.IllegalArgumentException
- if an argument is nullPipelinedComparator.getParserProperty(String)
,
XMLReader.setProperty(java.lang.String, java.lang.Object)
public java.lang.Object getParserProperty(java.lang.String name) throws PropertyNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the property whose value is being queriedPropertyNotRecognizedException
- if the property name is not recognizedjava.lang.IllegalArgumentException
- if the argument is nullPipelinedComparator.setParserProperty(String, Object)
public void setComparatorFeature(java.lang.String name, boolean value) throws FeatureNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the feature whose value is being configuredvalue
- the new value for the featurejava.lang.IllegalArgumentException
- when the feature name parameter is nullFeatureNotRecognizedException
- if the feature name is not recognizedPipelinedComparator.getComparatorFeature(String)
,
XMLComparator.setFeature(String, boolean)
public boolean getComparatorFeature(java.lang.String name) throws FeatureNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the feature whose value is being queriedjava.lang.IllegalArgumentException
- when the feature name parameter is nullFeatureNotRecognizedException
- if the feature name is not recognizedPipelinedComparator.setComparatorFeature(String, boolean)
,
XMLComparator.getFeature(String)
public void setComparatorProperty(java.lang.String name, java.lang.Object value) throws PropertyNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the property to be setvalue
- the Object representing the value of the propertyPropertyNotRecognizedException
- if the property name is not recognizedjava.lang.IllegalArgumentException
- if a parameter is nullPipelinedComparator.getComparatorProperty(String)
,
XMLComparator.setProperty(String, Object)
public java.lang.Object getComparatorProperty(java.lang.String name) throws PropertyNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the property whose value is being queriedPropertyNotRecognizedException
- if the property name is not recognizedjava.lang.IllegalArgumentException
- if the property name is nullPipelinedComparator.setComparatorProperty(String, Object)
,
XMLComparator.getFeature(String)
public void setOutputProperty(java.lang.String name, java.lang.String value) throws PropertyNotRecognizedException, java.lang.IllegalArgumentException
Configures output formatting and control.
Any properties set here are then passed to the serializer when the compare method is invoked. Earlier releases supported only a limited subset of the common properties. The drawback of the new approach is that PropertyNotRecognized exceptions cannot be reported immediately when the property is set.
NOTE The Saxon XSLT processor will throw an XPathException which in turn will be presented as an PipelineProcessingException 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 ideally be set using the OutputKeys
static fields as follows:
PipelinedComparator pc= new PipelinedComparator(); ... pc.setOutputProperty(OutputKeys.INDENT, "yes");
name
- the name of the property to setvalue
- the new value for the propertyjava.lang.IllegalArgumentException
- if a parameter is nullPropertyNotRecognizedException
- this exception is no longer thrown. An IllegalArgumentException is now thrown by the
compare method itself.Transformer.setOutputProperties(Properties)
,
Properties.setProperty(String, String)
,
OutputKeys
,
XSLT 2.0 and XQuery 1.0
Serialization, section 5.1.5public java.lang.String getOutputProperty(java.lang.String name) throws PropertyNotRecognizedException, java.lang.IllegalArgumentException
name
- the name of the output property whose value is being queriedjava.lang.IllegalArgumentException
- if the property name is nullPropertyNotRecognizedException
- this exception is no longer thrown. The behaviour of this method is now symmetrical to
that of Properties.getProperty(String)
.Transformer.getOutputProperty(java.lang.String)
,
OutputKeys
public void setInputFilters(javax.xml.transform.Templates[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
TransformerFactory tf= ...; Templates filter1= tf.newTemplates(new StreamSource(new File("/path/to/filters/filter1.xsl"))); Templates filter2= tf.newTemplates(new StreamSource(new File("/path/to/filters/filter2.xsl"))); PipelinedComparator pc= ...; pc.setInputFilters(new Templates[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the parser. The Templates objects are converted to XMLFilter classes. Two instances of each class are instantiated, one for each Comparator input. Note: All of the templates in the parameter must have been produced by the same TransformerFactory that is in effect. It is not possible to manipulate the
javax.xml.transformer.TransformerFactory
system property so that
different filters use different XSLT processors.filters
- the Templates array to be set as the input filters for this PipelinedComparatorFilterConfigurationException
- when there is a problem converting a Templates object to an XMLFilterjava.lang.IllegalArgumentException
- if the filter array is nullTransformerFactory.newTemplates(Source)
public void setInput1Filters(javax.xml.transform.Templates[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method are applied to input 1 only. See PipelinedComparator.setInputFilters(Templates[])
for more details.
filters
- the Templates array to be set as the input filters on input 1 for this PipelinedComparatorFilterConfigurationException
- when there is a problem converting a Templates object to an XMLFilterjava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(Templates[])
,
TransformerFactory.newTemplates(Source)
public void setInput2Filters(javax.xml.transform.Templates[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method are applied to input 2 only. See PipelinedComparator.setInputFilters(Templates[])
for more details.
filters
- the Templates array to be set as the input filters on input 2 for this PipelinedComparatorFilterConfigurationException
- when there is a problem converting a Templates object to an XMLFilterjava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(Templates[])
,
TransformerFactory.newTemplates(Source)
public void setInputFilters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters) throws FilterClassIncompatibilityException, FilterClassInstantiationException, java.lang.IllegalArgumentException
import com.deltaxml.pipe.filters.NormalizeSpace; import com.deltaxml.pipe.filters.XSDKey; ... PipelinedComparator pc= ...; pc.setInputFilters(new Class[] { NormalizeSpace.class, XSDKey.class });The filters are applied in array-order, with the first filter applied to the SAX events produced by the parser. Two instances of each specified class are instantiated, one for each Comparator input.
filters
- the Class array to be set as input filters for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)java.lang.IllegalArgumentException
- if the filter array is nullpublic void setInput1Filters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters) throws FilterClassIncompatibilityException, FilterClassInstantiationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 1 only. See PipelinedComparator.setInputFilters(Class[])
for more details
filters
- the Class array to be set as input filters on input 1 for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)java.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(Class[])
public void setInput2Filters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters) throws FilterClassIncompatibilityException, FilterClassInstantiationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 2 only. See PipelinedComparator.setInputFilters(Class[])
for more details
filters
- the Class array to be set as input filters on input 2 for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)java.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(Class[])
public void setInputFilters(java.util.List<?> filters) throws FilterClassInstantiationException, FilterClassIncompatibilityException, UnsupportedFilterListMemberException, FilterConfigurationException, java.lang.IllegalArgumentException, FilterParameterizationException, FilterParameterizationNotSupportedException
filters
- the List object to be set as the input filters for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)UnsupportedFilterListMemberException
- if a list member is not a supported filter typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterjava.lang.IllegalArgumentException
- if the filter List is nullFilterParameterizationException
- if there is a problem setting parameters on a Java filterFilterParameterizationNotSupportedException
- if the underlying XSLT processor does not allow access to the transformer
and thus parameter setting.PipelinedComparator.setInputFilters(Class[])
,
PipelinedComparator.setInputFilters(File[])
,
PipelinedComparator.setInputFilters(URL[])
,
PipelinedComparator.setInputFilters(Templates[])
,
PipelinedComparator.setInputFilters(ParameterizedFilter[])
public void setInput1Filters(java.util.List<?> filters) throws FilterClassInstantiationException, FilterClassIncompatibilityException, UnsupportedFilterListMemberException, FilterConfigurationException, FilterParameterizationException, FilterParameterizationNotSupportedException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 1 only. See PipelinedComparator.setInputFilters(List)
for more details.
filters
- the List object to be set as the input filters on input 1 for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)UnsupportedFilterListMemberException
- if a list member is not a supported filter typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterjava.lang.IllegalArgumentException
- if the filter List is nullFilterParameterizationException
- if there is a problem setting parameters on a Java filterFilterParameterizationNotSupportedException
- if the underlying XSLT processor does not support allow access to the
transformer and thus parameter setting.PipelinedComparator.setInputFilters(List)
,
PipelinedComparator.setInput1Filters(Class[])
,
PipelinedComparator.setInput1Filters(File[])
,
PipelinedComparator.setInput1Filters(URL[])
,
PipelinedComparator.setInput1Filters(Templates[])
public void setInput2Filters(java.util.List<?> filters) throws FilterClassInstantiationException, FilterClassIncompatibilityException, UnsupportedFilterListMemberException, FilterConfigurationException, FilterParameterizationException, FilterParameterizationNotSupportedException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 2 only. See PipelinedComparator.setInputFilters(List)
for more details.
filters
- the List object to be set as the input filters on input 2 for this PipelinedComparatorFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)UnsupportedFilterListMemberException
- if a list member is not a supported filter typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterjava.lang.IllegalArgumentException
- if the filter List is nullFilterParameterizationException
- if there is a problem setting parameters on a Java filterFilterParameterizationNotSupportedException
- if the underlying XSLT processor does not support allow access to the
transformer and thus parameter setting.PipelinedComparator.setInputFilters(List)
,
PipelinedComparator.setInput2Filters(Class[])
,
PipelinedComparator.setInput2Filters(File[])
,
PipelinedComparator.setInput2Filters(URL[])
,
PipelinedComparator.setInput2Filters(Templates[])
public void setInputFilters(java.net.URL[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
URL filter1= new URL("file://path/to/filter/filter1.xsl"); URL filter2= new URL("http://my.server.com/filters/filter2.xsl"); PipelinedComparator pc= ...; pc.setInputFilters(new URL[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the parser. The XSL filters are converted to XMLFilter classes. Two instances of each class are instantiated, one for each Comparator input.
filters
- the URL array to be set as the input filters for this PipelinedComparatorFilterConfigurationException
- If there is a problem setting up the filter from the URLjava.lang.IllegalArgumentException
- if the filter array is nullpublic void setInput1Filters(java.net.URL[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 1 only. See PipelinedComparator.setInputFilters(URL[])
for more details.
filters
- the URL array to be set as the input filters on input 1 for this PipelinedComparatorFilterConfigurationException
- If there is a problem setting up the filter from the URLjava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(URL[])
public void setInput2Filters(java.net.URL[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 2 only. See PipelinedComparator.setInputFilters(URL[])
for more details.
filters
- the URL array to be set as the input filters on input 2 for this PipelinedComparatorFilterConfigurationException
- If there is a problem setting up the filter from the URLjava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(URL[])
public void setInputFilters(java.io.File[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
File filter1= new File("/path/to/filter/filter1.xsl"); File filter2= new File("/path/to/filter/filter2.xsl"); PipelinedComparator pc= ...; pc.setInputFilters(new File[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the parser. The XSL filters are converted to XMLFilter classes. Two instances of each class are instantiated, one for each Comparator input.
filters
- the File array to be set as the input filters for this PipelinedComparatorFilterConfigurationException
- if there is a problem setting up the filter from the Filejava.lang.IllegalArgumentException
- if the filter array is nullpublic void setInput1Filters(java.io.File[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 1 only. See PipelinedComparator.setInputFilters(File[])
for more details.
filters
- the File array to be set as the input filters on input 1 for this PipelinedComparatorFilterConfigurationException
- if there is a problem setting up the filter from the Filejava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(File[])
public void setInput2Filters(java.io.File[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
Filters added using this method will be applied to input 2 only. See PipelinedComparator.setInputFilters(File[])
for more details.
filters
- the File array to be set as the input filters on input 2 for this PipelinedComparatorFilterConfigurationException
- if there is a problem setting up the filter from the Filejava.lang.IllegalArgumentException
- if the filter array is nullPipelinedComparator.setInputFilters(File[])
public void setInputFilters(ParameterizedFilter[] filters) throws FilterClassInstantiationException, FilterParameterizationNotSupportedException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException
ParameterizedFilter filter1= new ParameterizedFilter(MyFilter1.class); ParameterizedFilter filter2= new ParameterizedFilter("path/to/filter/myfilter2.xsl"); PipelinedComparator pc= ...; pc.setInputFilters(new ParameterizedFilter[] { filter1, filter2 });Parameters must be set on the filters before adding them to the PipelinedComparator. Filters are applied in the order in which they appear in the array. Two instances of each filter are instantiated, one for each of the Comparator inputs.
filters
- the ParameterizedFilter array to be set as the input filters for this PipelinedComparatorFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)FilterParameterizationNotSupportedException
- if the underlying XSLT processor does not allow access to the transformer
and thus parameter settingFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there is a problem setting parameters on a Java filterParameterizedFilter
,
ParameterizedFilter.setStringParameter(String, String)
public void setInput1Filters(ParameterizedFilter[] filters) throws FilterClassInstantiationException, FilterParameterizationNotSupportedException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException
Filters added using this method will be applied to input 1 only. See PipelinedComparator.setInputFilters(ParameterizedFilter[])
for more
details.
filters
- the ParameterizedFilter array to be set as the input filters on input 1 for this PipelinedComparatorFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)FilterParameterizationNotSupportedException
- if the underlying XSLT processor does not allow access to the transformer
and thus parameter settingFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there is a problem setting parameters on a Java filterPipelinedComparator.setInputFilters(ParameterizedFilter[])
,
ParameterizedFilter
,
ParameterizedFilter.setStringParameter(String, String)
public void setInput2Filters(ParameterizedFilter[] filters) throws FilterClassInstantiationException, FilterParameterizationNotSupportedException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException
Filters added using this method will be applied to input 2 only. See PipelinedComparator.setInputFilters(ParameterizedFilter[])
for more
details.
filters
- the ParameterizedFilter array to be set as the input filters on input 2 for this PipelinedComparatorFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)FilterParameterizationNotSupportedException
- if the underlying XSLT processor does not allow access to the transformer
and thus parameter settingFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there is a problem setting parameters on a Java filterPipelinedComparator.setInputFilters(ParameterizedFilter[])
,
ParameterizedFilter
,
ParameterizedFilter.setStringParameter(String, String)
public void setOutputFilters(javax.xml.transform.Templates[] templates) throws FilterConfigurationException, java.lang.IllegalArgumentException
TransformerFactory tf= ...; Templates filter1= tf.newTemplates(new StreamSource(new File("/path/to/filters/filter1.xsl"))); Templates filter2= tf.newTemplates(new StreamSource(new File("/path/to/filters/filter2.xsl"))); PipelinedComparator pc= ...; pc.setOutputFilters(new Templates[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the Comparator. Note: All of the templates in the parameter must have been produced by the same TransformerFactory that is in effect. It is not possible to manipulate the
javax.xml.transformer.TransformerFactory
system property so that
different filters use different XSLT processors. Note: Due to a limitation in Saxon (a TransformerHandler is
not serially reusable) this method should be called repeatedly before every compare or isEqual method.templates
- the Templates array to be set as the output filters for this PipelinedComparatorFilterConfigurationException
- if there is a problem converting the filter to a TransformerHandlerjava.lang.IllegalArgumentException
- if the templates array is nullTransformerFactory.newTemplates(Source)
public void setOutputFilters(java.lang.Class<org.xml.sax.helpers.XMLFilterImpl>[] filters) throws java.lang.IllegalArgumentException, FilterClassIncompatibilityException, FilterClassInstantiationException
import com.deltaxml.pipe.filters.WordByWordOutfilter1; import com.deltaxml.pipe.filters.WordByWordOutfilter2; ... PipelinedComparator pc= ...; pc.setOutputFilters(new Class[] { WordByWordOutfilter1.class, WordByWordOutfilter2.class });The filters are applied in array-order, with the first filter receiving SAX events produced by the comparator.
filters
- the Class array to be set as the output filters for this PipelinedComparatorjava.lang.IllegalArgumentException
- if the array is nullFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)XMLFilterImpl
,
XMLPushFilter
public void setOutputFilters(ParameterizedFilter[] filters) throws FilterClassIncompatibilityException, FilterConfigurationException, FilterClassInstantiationException, FilterParameterizationException, FilterParameterizationNotSupportedException
ParameterizedFilter filter1= new ParameterizedFilter(MyFilter1.class); ParameterizedFilter filter2= new ParameterizedFilter("path/to/filter/myfilter2.xsl"); PipelinedComparator pc= ...; pc.setOutputFilters(new ParameterizedFilter[] { filter1, filter2 });Parameters must be set on the filters before adding them to the PipelinedComparator. Filters are applied in the order in which they appear in the array. Note: Due to a limitation in Saxon (a TransformerHandler is not serially reusable) this method should be called repeatedly before every compare or isEqual method.
filters
- the ParameterizedFilter array to be set as the output filters for this PipelinedComparatorFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)FilterParameterizationNotSupportedException
- if the underlying XSLT processor does not allow access to the transformer
and thus parameter settingFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there is a problem setting parameters on a Java filterParameterizedFilter
,
ParameterizedFilter.setStringParameter(String, String)
public void setOutputFilters(java.util.List<?> filters) throws FilterClassIncompatibilityException, FilterClassInstantiationException, UnsupportedFilterListMemberException, FilterConfigurationException, java.lang.IllegalArgumentException, FilterParameterizationException
filters
- the List object to be set as the output filters for this PipelinedComparatorjava.lang.IllegalArgumentException
- if the List is nullFilterClassIncompatibilityException
- if the supplied class is not assignment compatible with those requiredFilterClassInstantiationException
- when there is a problem instantiating the supplied class(es)UnsupportedFilterListMemberException
- if a list member is not a supported filter typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there is a problem setting parameters on a Java filterPipelinedComparator.setOutputFilters(Class[])
,
PipelinedComparator.setOutputFilters(File[])
,
PipelinedComparator.setOutputFilters(URL[])
,
PipelinedComparator.setOutputFilters(Templates[])
,
PipelinedComparator.setInputFilters(ParameterizedFilter[])
public void setOutputFilters(java.net.URL[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
URL filter1= new URL("file://path/to/filter/filter1.xsl"); URL filter2= new URL("http://my.server.com/filters/filter2.xsl"); PipelinedComparator pc= ...; pc.setOutputFilters(new URL[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the Comparator. Note: Due to a limitation in Saxon (a TransformerHandler is not serially reusable) this method should be called repeatedly before every compare or isEqual method.
filters
- the URL array to be set as the output filters for this PipelinedComparatorjava.lang.IllegalArgumentException
- if the URL array is nullFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterpublic void setOutputFilters(java.io.File[] filters) throws FilterConfigurationException, java.lang.IllegalArgumentException
File filter1= new File("/path/to/filter/filter1.xsl"); File filter2= new File("/path/to/filter/filter2.xsl"); PipelinedComparator pc= ...; pc.setOutputFilters(new File[] { filter1, filter2 });The filters are applied in array-order, with the first filter applied to the SAX events produced by the Comparator. Note: Due to a limitation in Saxon (a TransformerHandler is not serially reusable) this method should be called repeatedly before every compare or isEqual method.
filters
- the File array to be set as the output filters to this PipelinedComparatorjava.lang.IllegalArgumentException
- if the array is nullFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterpublic void setRedistributionLicenseContent(long[] encodedLicense) throws LicenseException
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.
The LicenseException will often contain an appropriate cause with further details. The 'see also' section of the
documentation lists some of these causes. Note that they are from the com.deltaxml.api
package.
encodedLicense
- a redistribution licenseLicenseException
- if there was a problem with the supplied licenseLicenseContentException
,
LicenseSecurityException
public void compare(javax.xml.transform.Source s1, javax.xml.transform.Source s2, javax.xml.transform.Result r) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, UnsupportedSourceException, java.lang.IllegalArgumentException, LicenseException
s1
- the first Source to compares2
- the second Source to compare against the firstr
- the Result object to which the resulting delta will be writtenPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedUnsupportedSourceException
- if an input Source subclass is not supportedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
public void compare(java.io.File f1, java.io.File f2, java.io.File result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
f1
- the first File object to comparef2
- the second File object to compare against the firstresult
- the File object in which to write the resulting differencePipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
public void compare(java.io.Reader r1, java.io.Reader r2, java.io.Writer result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
Warning: Using this compare method with input data that refers to relative URIs is not recommended. We would
recommend using PipelinedComparator.compare(Source, Source, Result)
and constructing StreamSources with a Reader and a systemId to
ensure that relative URIs are referenced correctly.
r1
- the first Reader object to comparer2
- the second Reader object to compare against the firstresult
- the Writer object to write the resulting difference toPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
,
StreamSource
public void compare(java.io.InputStream is1, java.io.InputStream is2, java.io.OutputStream result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
Warning: Using this compare method with input data that refers to relative URIs is not recommended. We would
recommend using PipelinedComparator.compare(Source, Source, Result)
and constructing StreamSources with an InputStream and a systemId to
ensure that relative URIs are referenced correctly.
is1
- the first InputStream to compareis2
- the second InputStream to compare against the firstresult
- the OutputStream on which to write the resulting differencePipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
,
StreamSource
public void compare(java.lang.String s1, java.lang.String s2, java.lang.StringBuffer result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
s1
- the first String object to compares2
- the second String object to compare against the firstresult
- the StringBuffer in which to write the resulting differencePipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
public void compare(java.net.URL u1, java.net.URL u2, java.net.URL result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
u1
- the first URL to compareu2
- the second URL to compare against the firstresult
- the URL to write the resulting difference toPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognized. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
public void compare(java.net.URL u1, java.net.URL u2, java.io.File result) throws PipelineProcessingException, IdentityTransformerSetupException, ComparatorInstantiationException, ParserInstantiationException, java.lang.IllegalArgumentException, LicenseException
u1
- the first URL to compareu2
- the second URL to compare against the firstresult
- the File in which to write the resulting differencePipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.IdentityTransformerSetupException
- if an XSLT identity transformer cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instaniatedjava.lang.IllegalArgumentException
- is thrown if any of the properties set using PipelinedComparator.setOutputProperty(String, String)
are
not recognised. See Transformer.setOutputProperties(Properties)
for more information.LicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.compare(Source, Source, Result)
public boolean isEqual(javax.xml.transform.Source s1, javax.xml.transform.Source s2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, UnsupportedSourceException, LicenseException
s1
- the first Source to compares2
- the second Source to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedUnsupportedSourceException
- if an input Source subclass is not supportedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
public boolean isEqual(java.io.File f1, java.io.File f2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, LicenseException
f1
- the first File object to comparef2
- the second File object to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
public boolean isEqual(java.io.Reader r1, java.io.Reader r2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, LicenseException
Warning: Using this isEqual method with input data that refers to relative URIs is not recommended. We would
recommend using PipelinedComparator.isEqual(Source, Source)
and constructing StreamSources with a Reader and a systemId to ensure that
relative URIs are referenced correctly.
r1
- the first Reader object to comparer2
- the second Reader object to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
,
StreamSource
public boolean isEqual(java.io.InputStream is1, java.io.InputStream is2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, LicenseException
Warning: Using this compare method with input data that refers to relative URIs is not recommended. We would
recommend using PipelinedComparator.compare(Source, Source, Result)
and constructing StreamSources with an InputStream and a systemId to
ensure that relative URIs are referenced correctly.
is1
- the first InputStream to compareis2
- the second InputStream to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
,
StreamSource
public boolean isEqual(java.lang.String s1, java.lang.String s2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, LicenseException
s1
- the first String object to compares2
- the second String object to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
public boolean isEqual(java.net.URL u1, java.net.URL u2) throws PipelineProcessingException, ComparatorInstantiationException, ParserInstantiationException, LicenseException
u1
- the first URL to compareu2
- the second URL to compare against the firstPipelineProcessingException
- if an unrecoverable error occurs during the course of the comparison.ComparatorInstantiationException
- if a Comparator cannot be instantiated or configured.ParserInstantiationException
- if a parser cannot be instantiatedLicenseException
- if there is a licensing problem or a concurrent license is not availableXMLComparator.isEqual(Source, Source)
Copyright © 2001-2018 DeltaXML Ltd. All Rights Reserved.