Class TextComparisonConfig

java.lang.Object
com.deltaxml.docbook.config.TextComparisonConfig

public class TextComparisonConfig extends Object
These parameters control how text is compared and whitespace handled.
  • Constructor Details

    • TextComparisonConfig

      public TextComparisonConfig()
      Create a new TextComparisonConfig instance. These parameters control how text is compared and whitespace handled.
    • TextComparisonConfig

      public TextComparisonConfig(WhitespaceProcessingMode whitespaceProcessingMode)
      Create a new TextComparisonConfig instance, 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 new TextComparisonConfig instance, 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

      public WhitespaceProcessingMode getWhitespaceProcessingMode()
      Gets the value of the whitespaceProcessingMode parameter.
      Returns:
      the value of the whitespaceProcessingMode parameter
    • setWhitespaceProcessingMode

      public void setWhitespaceProcessingMode(WhitespaceProcessingMode value)

      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:space attribute 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