Class CalsTableConfiguration

java.lang.Object
com.deltaxml.mergecommon.config.CalsTableConfiguration

public class CalsTableConfiguration extends Object

Specifies configuration options for CALS table comparison. These configuration options can be specified on a ConcurrentMerge, SequentialMerge and ThreeWayMerge to configure its behavior when comparing CALS tables.

Since:
8.0
  • Constructor Details

  • Method Details

    • setProcessTables

      public void setProcessTables(boolean value)

      Specifies whether to apply CALS table processing.

      CALS table processing ensures that when valid (both syntactically and semantically according to the OASIS CALS table model documentation) input tables are provided the result will be a valid CALS table.

      Simple changes to the table, such as changing the contents of an entry, adding a row or column are generally represented as fine grain changes. Because CALS entries can overlap or span multiple rows and columns, some types of change are difficult to represent at fine granularity, whilst ensuring validity. In these cases changes are represented at row (ie, groups of added/deleted rows) or even whole-table granularity.

      Setting this parameter to false turns off this processing, therefore it is possible to generate an invalid table. However, if table validity is not a concern changes may be represented at finer granularity.

      Default: true

      Parameters:
      value - a boolean value to enable CALS table processing
    • isProcessTables

      public boolean isProcessTables()

      Determines whether CALS table processing is enabled.

      Returns:
      a boolean describing the enabled state of CALS table processing
    • setInvalidTableBehaviour

      public void setInvalidTableBehaviour(InvalidTableBehaviour behaviour)

      In order to ensure that only valid CALS tables are passed to our specialized CALS table processing, each input table is marked either valid or invalid. This parameter declares what type of processing should be used for those tables that are marked as invalid. The 'warning report mode' parameter configures how recoverable errors are reported.

      Three options are provided: fail, propagate up, and compare as XML. The fail option stops the comparison by throwing an appropriate exception (that includes the errors identified by the validity checker). The propagate up option ensures that changes to an invalid table (or more specifically 'tgroup') are represented at the table level. The compare as XML option essentially compares the tables as if they were well-formed XML.

      Note that the results of the compare as XML option can differ from comparing the tables without CALS table processing enabled, as a small amount of CALS specific processing is applied to invalid tables in order to allow them to be compared against a similar valid table.

      Default: InvalidTableBehaviour.PROPAGATE_UP

      Parameters:
      behaviour - the value to set for the InvalidTableBehaviour parameter
      Throws:
      IllegalArgumentException - if the value is null
      See Also:
    • getInvalidTableBehaviour

      public InvalidTableBehaviour getInvalidTableBehaviour()
      Returns the current behavior in use when inputs contain invalid CALS tables.
      Returns:
      an instance of InvalidTableBehaviour describing the behavior in use
    • setWarningReportMode

      public void setWarningReportMode(WarningReportMode mode)
      Specifies how CALS table invalidity warnings should be reported.
      Parameters:
      mode - the WarningReportMode to use when invalid CALS tables are encountered
    • getWarningReportMode

      public WarningReportMode getWarningReportMode()
      Returns the WarningReportMode in use when invalid CALS tables are encountered.
      Returns:
      an instance of WarningReportMode describing the reporting mode in use
    • setValidationLevel

      public void setValidationLevel(ValidationLevel level)

      Sets the ValidationLevel to use for CALS table validation.

      A value of ValidationLevel.STRICT will cause the InvalidTableBehaviour mode to be used for any CALS invalidity. A value of ValidationLevel.RELAXED means that invalidities which are known to have no effect on CALS processing will not prevent CALS processing from running. N.B. Warnings will be reported according to the WarningReportMode regardless of the setting used here.

      Parameters:
      level - an instance of ValidationLevel describing the level to use
    • getValidationLevel

      public ValidationLevel getValidationLevel()

      Returns the ValidationLevel current in use when validating CALS tables.

      Returns:
      an instance of ValidationLevel describing the level in use
    • setIgnoreColumnOrder

      public void setIgnoreColumnOrder(boolean ignoreColumnOrder)

      Sets whether the DocumentComparator should ignore CALS table column order.

      Parameters:
      ignoreColumnOrder - whether to ignore CALS table column order
    • isIgnoreColumnOrder

      public boolean isIgnoreColumnOrder()

      Determines whether ignoring CALS table column order is enabled.

      Returns:
      a boolean describing whether the CALS table column order is ignored
    • setCalsColumnKeyingMode

      public void setCalsColumnKeyingMode(CalsColumnKeyingMode mode)

      Sets the CalsColumnKeyingMode to use when comparing CALS tables.

      Parameters:
      mode - an instance of CalsColumnKeyingMode describing the keying mode to use
    • getCalsColumnKeyingMode

      public CalsColumnKeyingMode getCalsColumnKeyingMode()

      Returns the CalsColumnKeyingMode currently in use when comparing CALS tables.

      Returns:
      an instance of CalsColumnKeyingMode describing the keying mode in use