Interface HTMLCompare
The entry point into the HTML Compare Java API.
Call create() to obtain an instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXML Namespace used by the HTML Compare configuration file. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a progress listener.voidaddLicenseFile(File licenseFile) Adds the license file for use with Flexera licensing.voidaddLicenseServer(String hostname) Adds a license server (for use with a flexera license server).voidaddLicenseServer(String hostname, int port) Adds a license server and port (for use with a flexera license server).voidClears all registered progress listeners.voidvoidcompare(InputSource inputA, InputSource inputB, StreamResult output) This method compares twoInputSourceand writes the result in XHTML format to aStreamResult.static HTMLComparecreate()Create a newHTMLCompareinstance.Get the currentComparisonTypeConfigurationin use by thisHTMLCompare.booleanGets whether the production of debug files is on or not.Get the current prefix used for debug result files.Gets the explicitly set EntityResolver in use by the comparison.getEntityResolver(boolean builtInResolver) Gets the EntityResolver in use by the comparison.Get the currentFormattingConfigurationin use by thisHTMLCompare.Get the currentHTMLConfigurationin use by thisHTMLCompare.Get the currentImageConfigurationin use by thisHTMLCompare.Get the currentMathMLConfigurationin use by thisHTMLCompare.Get the currentSvgConfigurationin use by thisHTMLCompare.Get the currentTableConfigurationin use by thisHTMLCompare.Gets the explicitly set URIResolver in use by the comparison.getURIResolver(boolean builtInResolver) Gets the URIResolver in use by the comparison.voidAdd a progress listener.voidsetComparisonTypeConfiguration(ComparisonTypeConfiguration comparisonTypeConfiguration) Set theComparisonTypeConfigurationto be used by thisHTMLCompare.voidsetDebugFiles(boolean debug) Sets whether to produce debug files for each filter.voidsetDebugFilesPrefix(String debugFolderName) Sets what name to use for the folder containing debug files.voidsetEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver) Sets the EntityResolver to use during the comparison.voidsetFormattingConfiguration(FormattingConfiguration formattingConfiguration) Set theFormattingConfigurationto be used by thisHTMLCompare.voidsetHtmlConfiguration(HTMLConfiguration htmlConfiguration) Set theHTMLConfigurationto be used by thisHTMLCompare.voidsetImageConfiguration(ImageConfiguration imageConfiguration) Set theImageConfigurationto be used by thisHTMLCompare.voidsetMathMLConfiguration(MathMLConfiguration mathMLConfiguration) Set theMathMLConfigurationto be used by thisHTMLCompare.voidsetSvgConfiguration(SvgConfiguration svgConfiguration) Set theSvgConfigurationto be used by thisHTMLCompare.voidsetTableConfiguration(TableConfiguration tableConfiguration) Set theTableConfigurationto be used by thisHTMLCompare.voidsetURIResolver(URIResolver resolver, boolean fallbackToDefaultCatalogResolver) Sets the URIResolver to use during the comparison.
-
Field Details
-
HTML_COMPARE_CONFIG_NAMESPACE
XML Namespace used by the HTML Compare configuration file.- See Also:
-
-
Method Details
-
create
Create a newHTMLCompareinstance.- Returns:
- the new
HTMLCompareinstance. - Throws:
HTMLCompareInitializationException
-
compare
void compare(InputSource inputA, InputSource inputB, StreamResult output) throws IOException, HTMLCompareException, com.deltaxml.licensing.LicenseException, ParserException, FilterException, DifferentRootElementException, InvalidInputException, InputLoadException, ComparisonCancelledException, SerializationException This method compares twoInputSourceand writes the result in XHTML format to aStreamResult.- Parameters:
inputA- TheInputSourcefor the "A" input.inputB- TheInputSourcefor the "B" input.output- TheStreamResultthat the result will be written to.- Throws:
IOException- if there was a problem reading the inputs or writing the comparison result.HTMLCompareException- if an HTML Compare specific error occurs.com.deltaxml.licensing.LicenseException- when the license cannot be read or is not validParserException- when there is a problem creating/configuring an XML parserFilterException- when an error occurs running a filter in the pipelineDifferentRootElementException- if the two input Files have different rootsInvalidInputException- if an input file is not in the correct formatInputLoadException- when there is a problem loading an input FileComparisonCancelledException- if a comparison is cancelled by some cancellation policySerializationException- when there is a problem writing the result File
-
compare
void compare(File inputA, File inputB, File output) throws IOException, HTMLCompareException, com.deltaxml.licensing.LicenseException, ParserException, FilterException, DifferentRootElementException, InvalidInputException, InputLoadException, ComparisonCancelledException, SerializationException - Parameters:
inputA- TheFilefor the "A" input.inputB- TheFilefor the "B" input.output- TheFilethat the result wil be written to.- Throws:
IOException- if there was a problem reading the inputs or writing the comparison result.HTMLCompareException- if an HTML Compare specific error occurs.com.deltaxml.licensing.LicenseException- when the license cannot be read or is not validParserException- when there is a problem creating/configuring an XML parserFilterException- when an error occurs running a filter in the pipelineDifferentRootElementException- if the two input Files have different rootsInvalidInputException- if an input file is not in the correct formatInputLoadException- when there is a problem loading an input FileComparisonCancelledException- if a comparison is cancelled by some cancellation policySerializationException- when there is a problem writing the result File
-
setDebugFiles
void setDebugFiles(boolean debug) Sets whether to produce debug files for each filter.- Parameters:
debug- sets whether to produce debug files for each filter, default is false.
-
getDebugFiles
boolean getDebugFiles()Gets whether the production of debug files is on or not.
- Returns:
- whether the production of debug files is on or not.
- See Also:
-
setDebugFilesPrefix
Sets what name to use for the folder containing debug files.- Parameters:
debugFolderName- the string name of the folder that contains debug files
-
getDebugFilesPrefix
String getDebugFilesPrefix()Get the current prefix used for debug result files.- Returns:
- the current prefix used for debug result files.
- See Also:
-
getEntityResolver
EntityResolver getEntityResolver()Gets the explicitly set EntityResolver in use by the comparison.
- Returns:
- the explicitly set EntityResolver in use by the comparison.
-
getEntityResolver
Gets the EntityResolver in use by the comparison.
- Parameters:
builtInResolver- Whether to get the built-in resolver (with any explicit enhancement), or just the explicitly set resolver.- Returns:
- the explicitly set EntityResolver in use by the comparison.
-
setEntityResolver
Sets the EntityResolver to use during the comparison.
By default, the Apache Commons Resolver is used as an EntityResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a
nullresolver and setting thefallbackToDefaultCatalogResolvertofalse.- Parameters:
resolver- The resolver to use. Using null removes an existing resolver.fallbackToDefaultCatalogResolver- Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the entity.
-
getURIResolver
URIResolver getURIResolver()Gets the explicitly set URIResolver in use by the comparison.
- Returns:
- the explicitly set URIResolver in use by the comparison.
-
getURIResolver
Gets the URIResolver in use by the comparison.
- Parameters:
builtInResolver- Whether to get the built-in resolver (with any explicit enhancement), or just the explicitly set resolver.- Returns:
- the explicitly set URIResolver in use by the comparison.
-
setURIResolver
Sets the URIResolver to use during the comparison.
By default, the Apache Commons Resolver is used as a URIResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a
nullresolver and setting thefallbackToDefaultCatalogResolvertofalse.- Parameters:
resolver- The resolver to use. Using null removes an existing resolver.fallbackToDefaultCatalogResolver- Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the URI.
-
addHTMLCompareProgressListener
Add a progress listener. This adds a progress listener to the list of registered progress listeners. The same listener may be added more than once.- Parameters:
listener- the progress listener to add.
-
removeHTMLCompareProgressListener
Add a progress listener. This adds a progress listener to the list of registered progress listeners. The same listener may be added more than once.- Parameters:
listener- the progress listener to add.
-
clearHTMLCompareProgressListener
void clearHTMLCompareProgressListener()Clears all registered progress listeners. -
addLicenseFile
void addLicenseFile(File licenseFile) throws com.deltaxml.licensing.LicenseSecurityException, IOException, com.deltaxml.licensing.LicenseException Adds the license file for use with Flexera licensing. This can be either simple server/named-user license file or a concurrent license file containing the USE_SERVER directive- Parameters:
licenseFile- the FlexLM format license file- Throws:
com.deltaxml.licensing.LicenseSecurityException- 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
Adds a license server (for use with a flexera license server).- Parameters:
hostname- of the license server host or its ip address- Throws:
com.deltaxml.licensing.LicenseException- if there is a problem using the license server
-
addLicenseServer
void addLicenseServer(String hostname, int port) throws IllegalArgumentException, com.deltaxml.licensing.LicenseException Adds a license server and port (for use with a flexera license server).- Parameters:
hostname- of 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
-
getComparisonTypeConfiguration
ComparisonTypeConfiguration getComparisonTypeConfiguration()Get the currentComparisonTypeConfigurationin use by thisHTMLCompare.- Returns:
- the current
ComparisonTypeConfiguration
-
setComparisonTypeConfiguration
Set theComparisonTypeConfigurationto be used by thisHTMLCompare.- Parameters:
comparisonTypeConfiguration- the newComparisonTypeConfigurationto be used.
-
getFormattingConfiguration
FormattingConfiguration getFormattingConfiguration()Get the currentFormattingConfigurationin use by thisHTMLCompare.- Returns:
- the current
FormattingConfiguration
-
setFormattingConfiguration
Set theFormattingConfigurationto be used by thisHTMLCompare.- Parameters:
formattingConfiguration- the newFormattingConfigurationto be used.
-
getTableConfiguration
TableConfiguration getTableConfiguration()Get the currentTableConfigurationin use by thisHTMLCompare.- Returns:
- the current
TableConfiguration
-
setTableConfiguration
Set theTableConfigurationto be used by thisHTMLCompare.- Parameters:
tableConfiguration- the newTableConfigurationto be used.
-
getMathMLConfiguration
MathMLConfiguration getMathMLConfiguration()Get the currentMathMLConfigurationin use by thisHTMLCompare.- Returns:
- the current
MathMLConfiguration
-
setMathMLConfiguration
Set theMathMLConfigurationto be used by thisHTMLCompare.- Parameters:
mathMLConfiguration- the newMathMLConfigurationto be used.
-
getSvgConfiguration
SvgConfiguration getSvgConfiguration()Get the currentSvgConfigurationin use by thisHTMLCompare.- Returns:
- the current
SvgConfiguration
-
setSvgConfiguration
Set theSvgConfigurationto be used by thisHTMLCompare.- Parameters:
svgConfiguration- the newSvgConfigurationto be used.
-
getHtmlConfiguration
HTMLConfiguration getHtmlConfiguration()Get the currentHTMLConfigurationin use by thisHTMLCompare.- Returns:
- the current
HTMLConfiguration
-
setHtmlConfiguration
Set theHTMLConfigurationto be used by thisHTMLCompare.- Parameters:
htmlConfiguration- the newHTMLConfigurationto be used.
-
getImageConfiguration
ImageConfiguration getImageConfiguration()Get the currentImageConfigurationin use by thisHTMLCompare.- Returns:
- the current
ImageConfiguration
-
setImageConfiguration
Set theImageConfigurationto be used by thisHTMLCompare.- Parameters:
imageConfiguration- the newImageConfigurationto be used.
-