DeltaXMLBaseException
- a supertype for the following generic exception parametersInvalidInputException
- a parameter for this exception used in various packageLicenseException
- a parameter for this exception used in various packageDifferentRootElementException
- a parameter for this exception used in various packageDoctypeChangeException
- a parameter for this exception used in various packageDoctypeMissingException
- a parameter for this exception used in various packageUnorderedDuplicateKeysException
- a parameter for this exception used in various packageDifferingOrderedAttributesException
- a parameter for this exception used in various packageUnorderedElementContainingPCDATAException
- a parameter for this exception used in various packagepublic interface MergeBase<DeltaXMLBaseException extends Exception,InvalidInputException extends DeltaXMLBaseException,LicenseException extends DeltaXMLBaseException,DifferentRootElementException extends DeltaXMLBaseException,DoctypeChangeException extends DeltaXMLBaseException,DoctypeMissingException extends DeltaXMLBaseException,UnorderedDuplicateKeysException extends DeltaXMLBaseException,DifferingOrderedAttributesException extends DeltaXMLBaseException,UnorderedElementContainingPCDATAException extends DeltaXMLBaseException>
A common interface for sequential merge classes. This interface is extended by the MergeCommon interface.
Modifier and Type | Method and Description |
---|---|
void |
addLicenseFile(File licenseFile)
Adds the license file for use with Flexera licensing.
|
void |
addLicenseServer(String hostname)
Adds a license server for use with concurrent licensing.
|
void |
addLicenseServer(String hostname,
int port)
Adds a license server and port for use with concurrent licensing.
|
void |
addProgressListener(MergeProgressListener listener)
Add a progress listener to the list of registered progress listeners.
|
void |
addVersion(File file,
String version)
Adds a version with a File input.
|
void |
addVersion(InputStream is,
String systemId,
String version)
Adds a version with an input stream input.
|
void |
addVersion(Reader r,
String systemId,
String version)
Adds a version with a File input.
|
void |
addVersion(URL url,
String version)
Adds a version with a URL input.
|
void |
clearProgressListeners()
Remove all currently registered progress listeners.
|
void |
extractAll(File file)
Extracts the entire content of all added versions of the Merger to a File using the deltaV2 merge format.
|
void |
extractAll(OutputStream os)
Extracts the entire content of all added versions of the Merger to a OutputStream using the deltaV2 merge format.
|
void |
extractAll(Writer w)
Extracts the entire content of all added versions of the Merger to a Writer using the deltaV2 merge format.
|
CalsTableConfiguration |
getCalsTableConfiguration()
Returns the current configuration options for CALS table comparison.
|
boolean |
getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
|
EntityResolver |
getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
|
EntityResolver |
getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
|
List<String> |
getFormatExtractionPriorityList()
Reports the current setting of the format extraction priority list.
|
FormattingOutputType |
getFormattingOutputType()
Get the output type used for representing formatting elements in the output.
|
HtmlTableConfiguration |
getHtmlTableConfiguration()
Returns the current configuration options for HTML table comparison.
|
List<String> |
getVersions()
Returns an immutable list of versions which have been added.
|
boolean |
getWordByWord()
Reports the state of the WordByWord setting.
|
void |
removeProgressListener(MergeProgressListener listener)
Remove a progress listener from the list of registered progress listeners.
|
void |
reset()
Reverts the state of the merger to the point where
MergeCommon.setAncestor(java.io.File, String) can be used. |
void |
setCalsTableConfiguration(CalsTableConfiguration config)
Sets the configuration options for CALS table comparison.
|
void |
setDebug(boolean debug)
Enables the generation of intermediate pipeline debug files.
|
void |
setElementSplitting(boolean enabled)
Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.
|
void |
setEntityResolver(EntityResolver resolver,
boolean fallbackToDefaultCatalogResolver)
Sets the EntityResolver to use during the comparison.
|
void |
setFormatExtractionPriorityList(List<String> priorityList)
Merge operations represent overlapping hierarchies from the input documents by flattening and subsequently fragmenting
formatting elements where necessary.
|
void |
setFormattingOutputType(FormattingOutputType formattingOutputType)
Set the output type used for representing formatting elements in the output.
|
void |
setHtmlTableConfiguration(HtmlTableConfiguration config)
Sets the configuration options for HTML table comparison.
|
void |
setIndent(boolean indent)
Enables indentation of output using the serializer output indent property.
|
void |
setLicenseFile(File licenseFile)
Deprecated.
|
void |
setLicenseServer(String hostname)
Deprecated.
|
void |
setLicenseServer(String hostname,
int port)
Deprecated.
|
void |
setRedistributionLicenseContent(long[] key)
Sets a redistribution license for use with subsequent three way merge operations.
|
void |
setWordByWord(boolean wbwValue)
Determines whether WordByWord filter is used.
|
void setWordByWord(boolean wbwValue) throws IllegalStateException
wbwValue
- The new WordByWord setting to use.IllegalStateException
- when this operation is not allowed according to the MergeStateboolean getWordByWord()
void setFormattingOutputType(FormattingOutputType formattingOutputType)
Set the output type used for representing formatting elements in the output. The default is
FormattingOutputType.DELTA_V_2_1
which represents Formatting Elements using our Delta v2.1 format.
formattingOutputType
- the type of representation to use.FormattingOutputType
FormattingOutputType getFormattingOutputType()
Get the output type used for representing formatting elements in the output.
FormattingOutputType
void setElementSplitting(boolean enabled) throws IllegalStateException
Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.
Note that element splitting does not happen when the WordByWord setting is 'false'.
Default: true
enabled
- whether or not to enable element splittingIllegalStateException
- when this operation is not allowed according to the MergeStateboolean getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
void addVersion(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, DifferentRootElementException extends DeltaXMLBaseException, InvalidInputException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException, UnorderedDuplicateKeysException extends DeltaXMLBaseException, DifferingOrderedAttributesException extends DeltaXMLBaseException, UnorderedElementContainingPCDATAException extends DeltaXMLBaseException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
file
- The input file which is the version to be added.version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.FileNotFoundException
- Thrown if the provided file object does not exist.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with
this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException
- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException
- Thrown if the input is invalid.LicenseException
- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException
- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.com.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
DifferentRootElementException extends DeltaXMLBaseException
void addVersion(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException extends DeltaXMLBaseException, DifferentRootElementException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException, UnorderedDuplicateKeysException extends DeltaXMLBaseException, DifferingOrderedAttributesException extends DeltaXMLBaseException, UnorderedElementContainingPCDATAException extends DeltaXMLBaseException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
is
- The input stream which is the version to be added.systemId
- The location of the version input stream (for relative lookup).version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with
this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException
- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException
- Thrown if the input is invalid.LicenseException
- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException
- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.com.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
InvalidInputException extends DeltaXMLBaseException
void addVersion(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException extends DeltaXMLBaseException, DifferentRootElementException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException, UnorderedDuplicateKeysException extends DeltaXMLBaseException, DifferingOrderedAttributesException extends DeltaXMLBaseException, UnorderedElementContainingPCDATAException extends DeltaXMLBaseException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
r
- The input reader which is the version to be added.systemId
- The location of the ancestor reader (for relative lookup).version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with
this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException
- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException
- Thrown if the input is invalid.LicenseException
- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException
- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.com.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
InvalidInputException extends DeltaXMLBaseException
void addVersion(URL url, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException extends DeltaXMLBaseException, DifferentRootElementException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException, IOException, UnorderedDuplicateKeysException extends DeltaXMLBaseException, DifferingOrderedAttributesException extends DeltaXMLBaseException, UnorderedElementContainingPCDATAException extends DeltaXMLBaseException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
url
- The URL which is the version to be added.version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.IOException
- Thrown if a stream for the supplied URL cannot be opened.IllegalStateException
- Thrown if the merger object's state is not STARTED or EXTRACTABLE.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with
this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException
- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException
- Thrown if the input is invalid.LicenseException
- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException
- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.com.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
InvalidInputException extends DeltaXMLBaseException
void extractAll(File file) throws IllegalStateException, DoctypeChangeException extends DeltaXMLBaseException, DoctypeMissingException extends DeltaXMLBaseException, InvalidInputException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException
file
- The file into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are doctype is missing and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its useDoctypeChangeException extends DeltaXMLBaseException
void extractAll(Writer w) throws IllegalStateException, DoctypeChangeException extends DeltaXMLBaseException, DoctypeMissingException extends DeltaXMLBaseException, InvalidInputException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException
w
- The writer into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are doctype is missing and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its useDoctypeChangeException extends DeltaXMLBaseException
void extractAll(OutputStream os) throws IllegalStateException, DoctypeChangeException extends DeltaXMLBaseException, DoctypeMissingException extends DeltaXMLBaseException, InvalidInputException extends DeltaXMLBaseException, LicenseException extends DeltaXMLBaseException
os
- The OutputStream into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are doctype is missing and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its useDoctypeChangeException extends DeltaXMLBaseException
void reset()
Reverts the state of the merger to the point where
MergeCommon.setAncestor(java.io.File, String)
can be used. This is useful if you want to
perform a new merge with the same configuration settings.
The merger has a state machine to control the proper ordering of setAncestor and addVersion methods. reset() is used to clear the ancestor and version state. After calling reset() a new ancestor should be provided.
It does not completely re-initialize a merger to the state it would have after calling the constructor, in particular settings for catalogs, entity resolvers and word by word are preserved through a reset method (methods are provided to change these settings, alternatively you can create a new merger object via the constructor).
List<String> getVersions()
void setCalsTableConfiguration(CalsTableConfiguration config)
Sets the configuration options for CALS table comparison.
config
- a CalsTableConfiguration
object that contains the settings to use for CALS table comparisonCalsTableConfiguration getCalsTableConfiguration()
Returns the current configuration options for CALS table comparison.
void setHtmlTableConfiguration(HtmlTableConfiguration config)
Sets the configuration options for HTML table comparison.
config
- a HtmlTableConfiguration
object that contains the settings to use for HTML table comparisonHtmlTableConfiguration getHtmlTableConfiguration()
Returns the current configuration options for HTML table comparison.
HtmlTableConfiguration
object that contains the settings to use for HTML table comparisonvoid setRedistributionLicenseContent(long[] key) throws LicenseException extends DeltaXMLBaseException
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.
A LicenseException should always contain a nested exception or cause containing further details of the underlying issue. This will be typically one of: LicenseContentException, CPUCountException, LicenseSecurityException, LicenseExpiredException, LicenseNotYetValidException, InvalidLicenseException, LicenseConcurrencyLimitException.
Note that some of the exceptions thrown here can also be thrown by a compare method. For example, it may be the case a license has not expired when calling this method, but for long running app-server processes may have expired when calling compare methods later.
key
- a redistribution licenseLicenseException
- if there are any problems with the supplied license or its useLicenseException extends DeltaXMLBaseException
@Deprecated void setLicenseFile(File licenseFile) throws SecurityException, IOException, LicenseException extends DeltaXMLBaseException
licenseFile
- the FlexLM format license fileSecurityException
- if the file cannot be accessedIOException
- if there are problems reading the fileLicenseException
- if there is a problem using the license fileLicenseException extends DeltaXMLBaseException
@Deprecated void setLicenseServer(String hostname) throws LicenseException extends DeltaXMLBaseException
hostname
- the license server host or its ip addressLicenseException
- if there is a problem using the license serverLicenseException extends DeltaXMLBaseException
@Deprecated void setLicenseServer(String hostname, int port) throws IllegalArgumentException, LicenseException extends DeltaXMLBaseException
hostname
- the license server host or its ip addressport
- the port number on the license server for the lmgrdIllegalArgumentException
- if the port number is out of rangeLicenseException
- if there is a problem using the license serverLicenseException extends DeltaXMLBaseException
void addLicenseFile(File licenseFile) throws SecurityException, IOException, LicenseException extends DeltaXMLBaseException
licenseFile
- the FlexLM format license fileSecurityException
- if the file cannot be accessedIOException
- if there are problems reading the fileLicenseException
- if there is a problem using the license fileLicenseException extends DeltaXMLBaseException
void addLicenseServer(String hostname) throws LicenseException extends DeltaXMLBaseException
hostname
- the license server host or its ip addressLicenseException
- if there is a problem using the license serverLicenseException extends DeltaXMLBaseException
void addLicenseServer(String hostname, int port) throws IllegalArgumentException, LicenseException extends DeltaXMLBaseException
hostname
- the license server host or its ip addressport
- the port number on the license server for the lmgrdIllegalArgumentException
- if the port number is out of rangeLicenseException
- if there is a problem using the license serverLicenseException extends DeltaXMLBaseException
void setDebug(boolean debug)
Enables the generation of intermediate pipeline debug files.
debug
- when true debug files are generatedvoid setIndent(boolean indent)
Enables indentation of output using the serializer output indent property.
indent
- when true the output is indentedEntityResolver getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
EntityResolver getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
builtInResolver
- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set
resolver.void setEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver)
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 null
resolver and setting the
fallbackToDefaultCatalogResolver
to false
.
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.IllegalStateException
- Thrown if the merger object's state is not INITIAL or RESET.void addProgressListener(MergeProgressListener listener)
listener
- the progress listener to register.void removeProgressListener(MergeProgressListener listener)
listener
- the progress listener to remove.void clearProgressListeners()
void setFormatExtractionPriorityList(List<String> priorityList)
Merge operations represent overlapping hierarchies from the input documents by flattening and subsequently fragmenting formatting elements where necessary.
To produce a result without overlapping or nesting of formatting elements, it may be necessary to remove formatting information in a controlled way.
The format extraction priority list specifies the list of versions by priority. This priority list will be used to extract formatting to resolve overlaps and nesting to produce a deltaV2 result.
Please note that if only some, not all, of the versions are specified in the priority list there is a possibility of format loss due to additions/deletions of formatting by the missing version(s).
priorityList
- a list of priority versions specified using StringsCopyright © 2023 Deltaman Group Ltd. All Rights Reserved.