public class ThreeWayMerge extends Object implements MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
The main class for three-way concurrent merge operations.
This class provides further output types beyond those provided in the ConcurrentMerge
class because some specific
three-way processing is possible when three inputs can be guaranteed. A set of 'single shot' merge methods are also provided,
these avoid the use of the setAncestor/addVersion/extract methods that are used in the n-way class.
Modifier and Type | Class and Description |
---|---|
static class |
ThreeWayMerge.ResultFormat
Deprecated.
This class has been deprecated in favour of TwoWayResultFormat
|
static class |
ThreeWayMerge.TwoWayResultFormat |
Constructor and Description |
---|
ThreeWayMerge()
Constructs a new ThreeWayMerge instance.
|
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.
|
String |
getAncestorVersion()
Returns the version name of the ancestor.
|
CalsTableConfiguration |
getCalsTableConfiguration()
Returns the current configuration options for CALS table comparison.
|
ConcurrentMergeState |
getCurrentState()
Returns the current state of the ThreeWayMerge object.
|
DoctypePreservationMode |
getDoctypePreservationMode()
Reports the current mode.
|
boolean |
getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
|
EntityReferencePreservationMode |
getEntityReferencePreservationMode()
Reports the current mode.
|
EntityResolver |
getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
|
EntityResolver |
getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
|
ExistingOxygenTCsProcessingMode |
getExistingOxygenTCsProcessingMode()
Reports the existing oxygen TCs processing mode used with three way track change output.
|
com.deltaxml.cores9api.FilterStepHelper |
getFilterStepHelper()
Returns the Filter Step helper.
|
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.
|
ThreeToTwoResultPreset |
getResultPreset()
Reports preset of three to to way merge use cases.
|
RuleConfiguration |
getRuleConfiguration()
Returns the currently used (for extract operations) rule configuration object.
|
ThreeWayMergeResultType |
getThreeWayResultType()
Reports the result type setting for the Merger.
|
TrackChangesAttributeMode |
getThreeWayTrackChangeAttributeMode()
Reports the attribute mode used with three way track change output.
|
ThreeWayMerge.TwoWayResultFormat |
getTwoWayResultFormat()
Reports the result format setting for the Merger.
|
List<String> |
getVersions()
Returns an immutable list of versions which have been added.
|
boolean |
getWordByWord()
Reports the state of the WordByWord setting.
|
boolean |
isNewTableProcessingEnabled()
Returns the current setting for new table processing.
|
void |
merge(File ancestor,
File edit1,
File edit2,
File result)
This method is used to perform three way merge of File inputs.
|
void |
merge(InputStream ancestor,
String systemIdAncestor,
InputStream edit1,
String systemIdEdit1,
InputStream edit2,
String systemIdEdit2,
OutputStream result)
This method is used to perform three way merge of InputStreams.
|
void |
merge(Reader ancestor,
String systemIdAncestor,
Reader edit1,
String systemIdEdit1,
Reader edit2,
String systemIdEdit2,
Writer result)
This method is used to perform three way merge with Readers.
|
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 |
setAncestor(File file,
String version)
Sets the ancestor document with a File input.
|
void |
setAncestor(InputStream is,
String systemId,
String version)
Sets the ancestor document with a InputStream.
|
void |
setAncestor(Reader r,
String systemId,
String version)
Sets the ancestor document with a Reader.
|
void |
setAncestor(URL url,
String version)
Sets the ancestor document with a URL.
|
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 |
setDoctypePreservationMode(DoctypePreservationMode mode)
Sets how Doctype declarations should be preserved in the result.
|
void |
setElementSplitting(boolean enabled)
Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.
|
void |
setEntityReferencePreservationMode(EntityReferencePreservationMode mode)
Sets how Entity references should be preserved.
|
void |
setEntityResolver(EntityResolver resolver,
boolean fallbackToDefaultCatalogResolver)
Sets the EntityResolver to use during the comparison.
|
void |
setExistingOxygenTCsProcessingMode(ExistingOxygenTCsProcessingMode mode)
Sets the existing oxygen TCs processing mode for three way track change output.
|
void |
setExtensionPoint(ExtensionPoint extensionPoint,
com.deltaxml.cores9api.FilterChain chain)
Sets the
FilterChain to run at the specified ExtensionPoint . |
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.
Deprecated in the favour of addLicenseFile.
|
void |
setLicenseServer(String hostname)
Deprecated.
Deprecated in the favour of addLicenseServer.
|
void |
setLicenseServer(String hostname,
int port)
Deprecated.
Deprecated in the favour of addLicenseServer.
|
void |
setRedistributionLicenseContent(long[] key)
Sets a redistribution license for use with subsequent three way merge operations.
|
void |
setRestUsageReporter(com.deltaxml.cores9api.common.usage.ComUsageReporter usageReporter) |
void |
setResultPreset(ThreeToTwoResultPreset p)
Used to preset three to to way merge use cases.
|
void |
setRuleConfiguration(RuleConfiguration rc)
Allows the rules for merge processing (during extract operations) to be specified.
|
void |
setTableProcessingAlgorithmVersion2(boolean value)
Enables new table processing algorithm for CALS and HTML table.
|
void |
setThreeWayResultType(ThreeWayMergeResultType type)
Sets the type of result which this Merger will produce.
|
void |
setThreeWayTrackChangeAttributeMode(TrackChangesAttributeMode mode)
Sets the attribute mode for three way track change output.
|
void |
setTwoWayResultFormat(ThreeWayMerge.TwoWayResultFormat rf)
Sets the result format which this Merger will produce.
|
void |
setWordByWord(boolean wbwValue)
Determines whether WordByWord filter is used.
|
public void setThreeWayResultType(ThreeWayMergeResultType type)
type
- the desired result typepublic ThreeWayMergeResultType getThreeWayResultType()
public void setTwoWayResultFormat(ThreeWayMerge.TwoWayResultFormat rf)
rf
- the desired result formatpublic ThreeWayMerge.TwoWayResultFormat getTwoWayResultFormat()
public void setDebug(boolean debug)
Enables the generation of intermediate pipeline debug files.
setDebug
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
debug
- when true debug files are generatedpublic void setIndent(boolean indent)
Enables indentation of output using the serializer output indent property.
setIndent
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
indent
- when true the output is indentedpublic EntityResolver getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
getEntityResolver
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public EntityResolver getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
getEntityResolver
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
builtInResolver
- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set
resolver.public void setEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver) throws IllegalStateException
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
.
setEntityResolver
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.public 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).
public ConcurrentMergeState getCurrentState()
Returns the current state of the ThreeWayMerge object. The state affects which methods can be validly be called, this is
documented in the ConcurrentMergeState
enumeration.
public void setAncestor(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, LicenseException
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.
setAncestor
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
file
- The input file which is the ancestor version.version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This must be an XML NMTOKENIllegalStateException
- Thrown if the merge object's state is not INITIAL or RESET.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN.FileNotFoundException
- Thrown if the provided file object does not exist.InvalidInputException
- Thrown if the input is invalid in some way.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.UnorderedDuplicateKeysException
- Thrown if there are duplicate keys in orderless merge.LicenseException
- Thrown if there is no license installed, or if the installed license is invalid.public void setAncestor(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException
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.
setAncestor
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
is
- The input steam which is the ancestor version.systemId
- The location of the ancestor 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 INITIAL or RESET.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN.InvalidInputException
- Thrown if the input is invalid in some way.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.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.public void setAncestor(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException
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.
setAncestor
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
r
- The reader which is the ancestor version.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 INITIAL or RESET.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN.InvalidInputException
- Thrown if the input is invalid in some way.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.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.public void setAncestor(URL url, String version) throws IllegalStateException, IllegalArgumentException, IOException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException
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.
setAncestor
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
url
- The URL to load as the ancestor version.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 INITIAL or RESET.IllegalArgumentException
- Thrown if the version parameter is not an NMTOKEN.IOException
- Thrown if a stream for the supplied URL cannot be opened.InvalidInputException
- Thrown if the input is invalid in some way.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.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.public void addVersion(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, 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.
addVersion
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.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.FileNotFoundException
- Thrown if the provided file object does not exist.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.cores9api.ComparisonCancelledException
com.deltaxml.core.PipelinedComparatorError
public void addVersion(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, 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.
addVersion
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.cores9api.ComparisonCancelledException
com.deltaxml.core.PipelinedComparatorError
public void addVersion(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, DifferingOrderedAttributesException, LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException, 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.
addVersion
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.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.UnorderedElementContainingPCDATAException
- Thrown if input contains mixed content in orderless merge.com.deltaxml.cores9api.ComparisonCancelledException
com.deltaxml.core.PipelinedComparatorError
public void addVersion(URL url, String version) throws IllegalStateException, IllegalArgumentException, IOException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, 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.
addVersion
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.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.IOException
- Thrown if a stream for the supplied URL cannot be opened.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.cores9api.ComparisonCancelledException
com.deltaxml.core.PipelinedComparatorError
public void setWordByWord(boolean wbwValue) throws IllegalStateException
setWordByWord
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
wbwValue
- The new WordByWord setting to use.IllegalStateException
- when this operation is not allowed according to the MergeStatepublic boolean getWordByWord()
getWordByWord
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public 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
setElementSplitting
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
enabled
- whether or not to enable element splittingIllegalStateException
- when this operation is not allowed according to the MergeStatepublic boolean getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
getElementSplitting
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setDoctypePreservationMode(DoctypePreservationMode mode)
The DoctypePreservationMode.PRESERVE_WHEN_UNCHANGED
setting is used by default.
mode
- the new preservation modepublic DoctypePreservationMode getDoctypePreservationMode()
public void setEntityReferencePreservationMode(EntityReferencePreservationMode mode)
The EntityReferencePreservationMode.PRESERVE_REFERENCES
setting is used by default.
mode
- the new preservation modepublic EntityReferencePreservationMode getEntityReferencePreservationMode()
public void setRuleConfiguration(RuleConfiguration rc)
rc
- A new set of rulespublic RuleConfiguration getRuleConfiguration()
public void extractAll(File file) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 usepublic void extractAll(Writer w) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 usepublic void extractAll(OutputStream os) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 usepublic String getAncestorVersion()
getAncestorVersion
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public List<String> getVersions()
getVersions
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void merge(File ancestor, File edit1, File edit2, File result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
ancestor
- The common ancestor.edit1
- First versionedit2
- second versionresult
- Result of a three way merge.DifferentRootElementException
- Thrown if any version has a different root XML element as the ancestor.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.UnorderedElementContainingPCDATAException
- if an orderless element contains PCDATA or text nodes.InvalidInputException
- Thrown if the input is invalid.FileNotFoundException
- Thrown if an attempt to open the file denoted by a specified pathname failsIllegalArgumentException
- 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.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are doctype missing and DoctypePreservationMode specifies that they are reportedcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
public void merge(InputStream ancestor, String systemIdAncestor, InputStream edit1, String systemIdEdit1, InputStream edit2, String systemIdEdit2, OutputStream result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
ancestor
- The common ancestor.systemIdAncestor
- The location of the ancestor input stream (for relative lookup).edit1
- First versionsystemIdEdit1
- The location of the version 1 input stream (for relative lookup).edit2
- second versionsystemIdEdit2
- The location of the version 2 input stream (for relative lookup).result
- Result of a three way merge.DifferentRootElementException
- Thrown if any version has a different root XML element to the ancestor.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.UnorderedElementContainingPCDATAException
- if an orderless element contains PCDATA or text nodes.InvalidInputException
- Thrown if the input is invalid.FileNotFoundException
- Thrown if an attempt to open the file denoted by a specified pathname has failedIllegalArgumentException
- 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.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are doctype missing and DoctypePreservationMode specifies that they are reportedcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
public void merge(Reader ancestor, String systemIdAncestor, Reader edit1, String systemIdEdit1, Reader edit2, String systemIdEdit2, Writer result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
ancestor
- The common ancestor.systemIdAncestor
- The location of the ancestor reader (for relative lookup).edit1
- First versionsystemIdEdit1
- The location of the version 1 reader (for relative lookup).edit2
- second versionsystemIdEdit2
- The location of the version 2 reader (for relative lookup).result
- Result of a three way merge.DifferentRootElementException
- Thrown if any version has a different root XML element to the ancestor.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.UnorderedElementContainingPCDATAException
- if an orderless element contains PCDATA or text nodes.InvalidInputException
- Thrown if the input is invalid.FileNotFoundException
- Thrown if an attempt to open the file denoted by a specified pathname has failedIllegalArgumentException
- 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.IllegalStateException
- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException
- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException
- when there are missing changes and DoctypePreservationMode specifies that they are reportedcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
public void setExtensionPoint(ExtensionPoint extensionPoint, com.deltaxml.cores9api.FilterChain chain)
Sets the FilterChain
to run at the specified ExtensionPoint
.
N.B. the supplied FilterChain
will have its name set to the name of the supplied
ExtensionPoint
parameter (i.e. the result of calling ExtensionPoint.toString()
).
extensionPoint
- the ExtensionPoint
at which to insert the FilterChain
;chain
- the FilterChain
containing the FilterSteps to insert at the specified extension pointpublic void setThreeWayTrackChangeAttributeMode(TrackChangesAttributeMode mode)
ThreeWayMergeResultType.THREE_WAY_OXYGEN_TRACK_CHANGES
The TrackChangesAttributeMode.TC_EDIT1
setting is used by default.
mode
- the desired attribute modepublic TrackChangesAttributeMode getThreeWayTrackChangeAttributeMode()
public void setExistingOxygenTCsProcessingMode(ExistingOxygenTCsProcessingMode mode)
ThreeWayMergeResultType.THREE_WAY_OXYGEN_TRACK_CHANGES
The ExistingOxygenTCsProcessingMode.ACCEPT
setting is used by default.
mode
- the desired existing oxygen TCs processing modepublic ExistingOxygenTCsProcessingMode getExistingOxygenTCsProcessingMode()
public void setResultPreset(ThreeToTwoResultPreset p)
Used to preset three to to way merge use cases.
The merge extraction process applies default rule configuration settings which executes before this method. Applying this
configuration overrides the different RuleConfiguration
and ThreeWayMergeResultType
settings applied prior to
this.
p
- the desired ThreeToTwoResultPreset
public ThreeToTwoResultPreset getResultPreset()
public com.deltaxml.cores9api.FilterStepHelper getFilterStepHelper()
Returns the Filter Step helper.
This can be used to create filters used to extend the Merger via its extension points.
public void setRedistributionLicenseContent(long[] key) 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.
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.
setRedistributionLicenseContent
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
key
- a redistribution licenseLicenseException
- if there are any problems with the supplied license or its use@Deprecated public void setLicenseFile(File licenseFile) throws SecurityException, IOException, LicenseException
setLicenseFile
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 file@Deprecated public void setLicenseServer(String hostname) throws LicenseException
setLicenseServer
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
hostname
- the license server host or its ip addressLicenseException
- if there is a problem using the license server@Deprecated public void setLicenseServer(String hostname, int port) throws IllegalArgumentException, LicenseException
setLicenseServer
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 serverpublic void addLicenseFile(File licenseFile) throws SecurityException, IOException, LicenseException
addLicenseFile
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 filepublic void addLicenseServer(String hostname) throws LicenseException
addLicenseServer
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
hostname
- the license server host or its ip addressLicenseException
- if there is a problem using the license serverpublic void addLicenseServer(String hostname, int port) throws IllegalArgumentException, LicenseException
addLicenseServer
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 serverpublic void setCalsTableConfiguration(CalsTableConfiguration config)
Sets the configuration options for CALS table comparison.
setCalsTableConfiguration
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
config
- a CalsTableConfiguration
object that contains the settings to use for CALS table comparisonpublic CalsTableConfiguration getCalsTableConfiguration()
Returns the current configuration options for CALS table comparison.
getCalsTableConfiguration
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setHtmlTableConfiguration(HtmlTableConfiguration config)
Sets the configuration options for HTML table comparison.
setHtmlTableConfiguration
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
config
- a HtmlTableConfiguration
object that contains the settings to use for HTML table comparisonpublic HtmlTableConfiguration getHtmlTableConfiguration()
Returns the current configuration options for HTML table comparison.
getHtmlTableConfiguration
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
HtmlTableConfiguration
object that contains the settings to use for HTML table comparisonpublic void addProgressListener(MergeProgressListener listener)
addProgressListener
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
listener
- the progress listener to register.public void removeProgressListener(MergeProgressListener listener)
removeProgressListener
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
listener
- the progress listener to remove.public void clearProgressListeners()
clearProgressListeners
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public 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.
setFormattingOutputType
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
formattingOutputType
- the type of representation to use.FormattingOutputType
public FormattingOutputType getFormattingOutputType()
Get the output type used for representing formatting elements in the output.
getFormattingOutputType
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
FormattingOutputType
public 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).
setFormatExtractionPriorityList
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
priorityList
- a list of priority versions specified using Stringspublic List<String> getFormatExtractionPriorityList()
getFormatExtractionPriorityList
in interface MergeBase<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setRestUsageReporter(com.deltaxml.cores9api.common.usage.ComUsageReporter usageReporter)
public boolean isNewTableProcessingEnabled()
isNewTableProcessingEnabled
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setTableProcessingAlgorithmVersion2(boolean value)
setTableProcessingAlgorithmVersion2
in interface MergeCommon<DeltaXMLMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,DoctypeMissingException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
value
- The new newTableProcessing setting to use.Copyright © 2023 Deltaman Group Ltd. All Rights Reserved.