Class TextComparisonConfig
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newTextComparisonConfiginstance.TextComparisonConfig(boolean characterByCharacter) Create a newTextComparisonConfiginstance, specifies whether to perform character by character comparison or not.TextComparisonConfig(WhitespaceProcessingMode whitespaceProcessingMode) Create a newTextComparisonConfiginstance, specifies how to handle whitespace changes. -
Method Summary
Modifier and TypeMethodDescriptionGets the value of the whitespaceProcessingMode parameter.booleanGets the value of the characterByCharacter parameter.voidsetCharacterByCharacter(boolean value) Specifies whether to perform character by character comparison or not.voidSpecifies how to handle whitespace changes.
-
Constructor Details
-
TextComparisonConfig
public TextComparisonConfig()Create a newTextComparisonConfiginstance. These parameters control how text is compared and whitespace handled. -
TextComparisonConfig
Create a newTextComparisonConfiginstance, specifies how to handle whitespace changes. These parameters control how text is compared and whitespace handled.- Parameters:
whitespaceProcessingMode- specifies how to handle whitespace changes.
-
TextComparisonConfig
public TextComparisonConfig(boolean characterByCharacter) Create a newTextComparisonConfiginstance, specifies whether to perform character by character comparison or not. These parameters control how text is compared and whitespace handled.- Parameters:
characterByCharacter- specifies whether to perform character by character comparison or not.
-
-
Method Details
-
getWhitespaceProcessingMode
Gets the value of the whitespaceProcessingMode parameter.- Returns:
- the value of the whitespaceProcessingMode parameter
-
setWhitespaceProcessingMode
Specifies how to handle whitespace changes.
When this option is set to 'show' whitespace differences are reported where possible. If the output-format is set to 'docbook-markup' and DocBook doctype is explicitly declared, then the whitespace will be reported wherever the doctype allows text (as opposed to inter-element whitespace). In all other cases, such as when tracked-change output format is selected, all whitespace changes can be shown.
This can lead to a significant amount of marked change throughout the document. When the parameter is set to 'ignore', whitespace differences are not shown; instead the 'B' document's whitespace is kept where possible.
Note that differences in whitespace are never ignored when the XML document explicitly states that the whitespace is important, via the
xml:spaceattribute being set to 'preserve'.The 'automatic' setting effectively behaves as either 'normalize' or 'ignore' depending on the value of the 'preservation-mode' and the 'output-format' parameters. Here, 'normalize' is chosen when: (1) the lexical preservation mode is set to 'automatic' and the output format is 'docbook-markup'; or (2) the lexical preservation mode is set to either 'document' or 'docAndAttrib'. In all other cases, the automatic preservation mode is treated as if it were 'ignore'.
Default:
WhitespaceProcessingMode.AUTOMATIC- Parameters:
value- the value to set for the whitespaceProcessingMode parameter- Throws:
IllegalArgumentException- if the value is null
-
isCharacterByCharacter
public boolean isCharacterByCharacter()Gets the value of the characterByCharacter parameter.- Returns:
- the value of the characterByCharacter parameter
-
setCharacterByCharacter
public void setCharacterByCharacter(boolean value) Specifies whether to perform character by character comparison or not.
If set to
true, text is split into strings of characters for comparison. This allows individual character changes to be detected.Default:
false- Parameters:
value- the value to set for the character-by-character parameter
-