public class DXPConfigurationS9
extends com.deltaxml.cores9api.AbstractDPConfigurationS9
Loads a PipelinedComparatorS9
from a DXP configuration.
DXP (DeltaXML Pipelines) is a declarative file format for describing comparator pipelines and could also be considered a form of customization language for comparator based tools. It supports DXP file format versions 1.0-2.4 as discussed in DXP User Guide.
This class provides methods for obtaining information from DXP files and also for loading a PipelinedComparatorS9 instance from DXP. The constructor of this class is generally responsible for ensuring validity of the input DXP.
PipelinedComparatorS9
Constructor and Description |
---|
DXPConfigurationS9(java.io.File f)
Creates a DXPConfigurationS9 object from a DXP file.
|
DXPConfigurationS9(org.xml.sax.InputSource dxpSource)
Creates a DXPConfigurationS9 object from an InputSource.
|
DXPConfigurationS9(org.xml.sax.InputSource dxpSource,
org.xml.sax.EntityResolver er,
boolean validate)
Creates a DXPConfigurationS9 object from a DXP InputSource.
|
DXPConfigurationS9(net.sf.saxon.s9api.XdmNode dxpSource)
Creates a DXPConfigurationS9 object from a supplied XdmNode tree.
|
Modifier and Type | Method and Description |
---|---|
PipelinedComparatorS9 |
generate()
Generates a PipelinedComparatorS9 from the DXP configuration loaded into this instance of a DXPConfigurationS9.
|
PipelinedComparatorS9 |
generate(java.util.Map<java.lang.String,java.lang.Boolean> booleanOverrides,
java.util.Map<java.lang.String,java.lang.String> stringOverrides)
Generates a PipelinedComparatorS9 from this instance of a DXPConfigurationS9.
|
PipelinedComparatorS9 |
generate(java.util.Map<java.lang.String,java.lang.Boolean> booleanOverrides,
java.util.Map<java.lang.String,java.lang.String> stringOverrides,
net.sf.saxon.s9api.Processor proc)
Generates a PipelinedComparatorS9 from this instance of a DXPConfigurationS9.
|
java.lang.String |
getFileExtension()
Returns the contents of the DXP
outputFileExtension/@extension attribute. |
static java.lang.String |
getFormattedPipelineSummaryTable(java.util.Collection<DXPConfigurationS9> dxpConfigs,
int width,
int indent)
A table summarising the provided pipelines as a multi-line string.
|
boolean |
isCorePipeline()
States whether this represents a core (XML Compare) pipeline or not.
|
getBooleanParameterList, getBooleanParameters, getDescription, getFormattedParametersDescription, getFormattedParametersDescription, getFullDescription, getId, getParameterDescriptions, getParameterList, getStringParameterList, getStringParameters, getSystemId, getURIResolver, setURIResolver, setURIResolver, toString
public DXPConfigurationS9(java.io.File f) throws ParserInstantiationException, java.io.FileNotFoundException, net.sf.saxon.s9api.SaxonApiException, InvalidPipelineException
f
- A File containing a DXP configurationParserInstantiationException
- if there are problems creating the parserjava.io.FileNotFoundException
- if the DXP file cannot be locatednet.sf.saxon.s9api.SaxonApiException
- if there are parsing errors or other s9api related problemsInvalidPipelineException
- if the DXP contains errors (beyond standard validation errors)DXPConfigurationS9.generate(Map, Map)
,
DXPConfigurationS9.generate()
public DXPConfigurationS9(org.xml.sax.InputSource dxpSource, org.xml.sax.EntityResolver er, boolean validate) throws ParserInstantiationException, net.sf.saxon.s9api.SaxonApiException, InvalidPipelineException
dxpSource
- An InputSource describing a DXP configurationer
- An EntityResolver for dealing with DTD and other external URL referencesvalidate
- controls parser validation (requires uses of a DTD)ParserInstantiationException
- if there are problems creating the parsernet.sf.saxon.s9api.SaxonApiException
- if there are parsing errors or other s9api related problemsInvalidPipelineException
- if the DXP contains errors (beyond standard validation errors)DXPConfigurationS9.generate(Map, Map)
,
DXPConfigurationS9.generate()
public DXPConfigurationS9(org.xml.sax.InputSource dxpSource) throws ParserInstantiationException, net.sf.saxon.s9api.SaxonApiException, InvalidPipelineException
dxpSource
- An InputSource describing a DXP configurationParserInstantiationException
- if there are problems creating the parsernet.sf.saxon.s9api.SaxonApiException
- if there are parsing errors or other s9api related problemsInvalidPipelineException
- if the DXP contains errors (beyond standard validation errors)public DXPConfigurationS9(net.sf.saxon.s9api.XdmNode dxpSource) throws InvalidPipelineException, java.lang.IllegalArgumentException
dxpSource
- An XdmNode tree containing a DXP pipeline definitionInvalidPipelineException
- if the DXP contains errors (beyond standard validation errors)java.lang.IllegalArgumentException
- if the supplied XdmNode is not a DOCUMENT or ELEMENT nodepublic final PipelinedComparatorS9 generate(java.util.Map<java.lang.String,java.lang.Boolean> booleanOverrides, java.util.Map<java.lang.String,java.lang.String> stringOverrides) throws java.lang.ClassNotFoundException, java.net.MalformedURLException, ParserInstantiationException, FilterClassInstantiationException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException, FeatureNotRecognizedException, FeatureSettingNotSupportedException, PropertyNotRecognizedException, ParameterValueConflict, NonUniqueParameterNameException, UnknownParameterException, ComparatorInstantiationException, ConditionalFilterXPathException, XPathFilterParameterException
Generates a PipelinedComparatorS9 from this instance of a DXPConfigurationS9.
This method allows parameters to be overridden when the pipeline is constructed. The Map arguments should correspond to the
declared 'pipelineParameters' in the associated DXP. An easy way to achieve this is to use and modify the Maps returned with
AbstractDPConfigurationS9.getBooleanParameters()
and AbstractDPConfigurationS9.getStringParameters()
.
This method throws a large number of exceptions. Further details of the circumstances in which they are thrown are documented
in the javadoc descriptions of the Exception classes themselves. Should fine-grain exception handling not be required, it is
possible to catch the PipelinedComparatorException
,
DXPConfigurationException
or DeltaXMLException
supertypes for all but two
(ClassNotFoundException
and MalformedURLException
) of the exceptions thrown by this method.
booleanOverrides
- parameter settings to override the boolean pipeline parametersstringOverrides
- parameter settings to override the string pipeline parametersjava.lang.ClassNotFoundException
- if a class specified in a DXP class element cannot be locatedjava.net.MalformedURLException
- if a DXP URL elements contents are malformedParserInstantiationException
- if the PipelinedComparatorS9 constructor throws this exceptionFilterClassInstantiationException
- if there are problems instantiating a Java class based filterFilterClassIncompatibilityException
- if a class is not of the correct typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there are problems setting the parameters on a Java filterFeatureNotRecognizedException
- if the feature, in a parserFeature element, is not recognizedFeatureSettingNotSupportedException
- if the setting of the specified parser feature is not supportedPropertyNotRecognizedException
- if the specified outputProperty is not recognizedParameterValueConflict
- if the attributes used to specify a filter or other parameter are in conflictNonUniqueParameterNameException
- if the PipelineParameter names are not uniqueUnknownParameterException
- if the referenced parameter name is not known/declaredComparatorInstantiationException
- if the comparator used in the pipeline cannot be instantiatedConditionalFilterXPathException
- if there is a problem with an XPath expression on a conditional filterXPathFilterParameterException
- if there is a problem with an XPath expression being used as a filter parameterpublic final PipelinedComparatorS9 generate(java.util.Map<java.lang.String,java.lang.Boolean> booleanOverrides, java.util.Map<java.lang.String,java.lang.String> stringOverrides, net.sf.saxon.s9api.Processor proc) throws java.lang.ClassNotFoundException, java.net.MalformedURLException, ParserInstantiationException, FilterClassInstantiationException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException, FeatureNotRecognizedException, FeatureSettingNotSupportedException, PropertyNotRecognizedException, ParameterValueConflict, NonUniqueParameterNameException, UnknownParameterException, ComparatorInstantiationException, java.lang.IllegalArgumentException, ConditionalFilterXPathException, XPathFilterParameterException
Generates a PipelinedComparatorS9 from this instance of a DXPConfigurationS9.
This method allows a Saxon s9api Processor to be specified and should be used if you intend to supply XdmNode inputs to the generated PipelinedComparatorS9.
This method allows parameters to be overridden when the pipeline is constructed. The Map arguments should correspond to the
declared 'pipelineParameters' in the associated DXP. An easy way to achieve this is to use and modify the Maps returned with
AbstractDPConfigurationS9.getBooleanParameters()
and AbstractDPConfigurationS9.getStringParameters()
.
This method throws a large number of exceptions. Further details of the circumstances in which they are thrown are documented
in the javadoc descriptions of the Exception classes themselves. Should fine-grain exception handling not be required, it is
possible to catch the PipelinedComparatorException
,
DXPConfigurationException
or DeltaXMLException
supertypes for all but two
(ClassNotFoundException
and MalformedURLException
) of the exceptions thrown by this method.
booleanOverrides
- parameter settings to override the boolean pipeline parametersstringOverrides
- parameter settings to override the string pipeline parametersproc
- a Saxon processor to be used for the NamePool and filter compilationjava.lang.ClassNotFoundException
- if a class specified in a DXP class element cannot be locatedjava.net.MalformedURLException
- if a DXP URL elements contents are malformedParserInstantiationException
- if the PipelinedComparatorS9 constructor throws this exceptionFilterClassInstantiationException
- if there are problems instantiating a Java class based filterFilterClassIncompatibilityException
- if a class is not of the correct typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there are problems setting the parameters on a Java filterFeatureNotRecognizedException
- if the feature, in a parserFeature element, is not recognizedFeatureSettingNotSupportedException
- if the setting of the specified parser feature is not supportedPropertyNotRecognizedException
- if the specified outputProperty is not recognizedParameterValueConflict
- if the attributes used to specify a filter or other parameter are in conflictNonUniqueParameterNameException
- if the PipelineParameter names are not uniqueUnknownParameterException
- if the referenced parameter name is not known/declaredComparatorInstantiationException
- if the comparator used in the pipeline cannot be instantiatedjava.lang.IllegalArgumentException
- if the Processor argument is nullConditionalFilterXPathException
- if there is a problem with an XPath expression on a conditional filterXPathFilterParameterException
- if there is a problem with an XPath expression being used as a filter parameterpublic boolean isCorePipeline()
public java.lang.String getFileExtension()
outputFileExtension/@extension
attribute. This can be used by applications to
alter the behaviour of an application based on the type of data generated. For example a pipeline producing HTML, using an
extension of "html
", may be processed differently (shown in a browser), to a pipeline with an "xml
"
extension.xml
"public final PipelinedComparatorS9 generate() throws java.lang.ClassNotFoundException, java.net.MalformedURLException, ParserInstantiationException, FilterClassInstantiationException, FilterClassIncompatibilityException, FilterConfigurationException, FilterParameterizationException, FeatureNotRecognizedException, FeatureSettingNotSupportedException, PropertyNotRecognizedException, ParameterValueConflict, NonUniqueParameterNameException, UnknownParameterException, ComparatorInstantiationException, ConditionalFilterXPathException, XPathFilterParameterException
Generates a PipelinedComparatorS9 from the DXP configuration loaded into this instance of a DXPConfigurationS9. This method allows does not allow parameter overriding.
This method throws a large number of exceptions. Further details of the circumstances in which they are thrown are documented
in the javadoc descriptions of the Exception classes themselves. Should fine-grain exception handling not be required, it is
possible to catch the PipelinedComparatorException
,
DXPConfigurationException
or DeltaXMLException
supertypes for all but two
(ClassNotFoundException
and MalformedURLException
) of the exceptions thrown by this method.
java.lang.ClassNotFoundException
- if a class specified in a DXP class element cannot be locatedjava.net.MalformedURLException
- if a DXP URL elements contents are malformedParserInstantiationException
- if the PipelinedComparatorS9 constructor throws this exceptionFilterClassInstantiationException
- if there are problems instantiating a Java class based filterFilterClassIncompatibilityException
- if a class is not of the correct typeFilterConfigurationException
- if there is a problem instantiating or configuring an XSLT based filterFilterParameterizationException
- if there are problems setting the parameters on a Java filterFeatureNotRecognizedException
- if the feature, in a parserFeature element, is not recognizedFeatureSettingNotSupportedException
- if the setting of the specified parser feature is not supportedPropertyNotRecognizedException
- if the specified outputProperty is not recognizedParameterValueConflict
- if the attributes used to specify a filter or other parameter are in conflictNonUniqueParameterNameException
- if the PipelineParameter names are not uniqueUnknownParameterException
- if the referenced parameter name is not known/declaredComparatorInstantiationException
- if the comparator used in the pipeline cannot be instantiatedConditionalFilterXPathException
- if there is a problem with an XPath expression on a conditional filterXPathFilterParameterException
- if there is a problem with an XPath expression being used as a filter parameterpublic static java.lang.String getFormattedPipelineSummaryTable(java.util.Collection<DXPConfigurationS9> dxpConfigs, int width, int indent)
dxpConfigs
- The dxpConfigurations to summarise.width
- the maximum width of each line for the description (not including the indent)indent
- the number of spaces to prefix each line with.