Class CalsTableConfiguration
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theCalsColumnKeyingModecurrently in use when comparing CALS tables.Returns the current behavior in use when inputs contain invalid CALS tables.Returns theValidationLevelcurrent in use when validating CALS tables.Returns theWarningReportModein use when invalid CALS tables are encountered.booleanDetermines whether ignoring CALS table column order is enabled.booleanDetermines whether CALS table processing is enabled.voidSets theCalsColumnKeyingModeto use when comparing CALS tables.voidsetIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether theDocumentComparatorshould ignore CALS table column order.voidsetInvalidTableBehaviour(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.voidsetProcessTables(boolean value) Specifies whether to apply CALS table processing.voidSets theValidationLevelto use for CALS table validation.voidSpecifies how CALS table invalidity warnings should be reported.
-
Constructor Details
-
CalsTableConfiguration
public CalsTableConfiguration()Constructs a newCalsTableConfigurationinstance.
-
-
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
falseturns 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
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
Returns the current behavior in use when inputs contain invalid CALS tables.- Returns:
- an instance of
InvalidTableBehaviourdescribing the behavior in use
-
setWarningReportMode
Specifies how CALS table invalidity warnings should be reported.- Parameters:
mode- theWarningReportModeto use when invalid CALS tables are encountered
-
getWarningReportMode
Returns theWarningReportModein use when invalid CALS tables are encountered.- Returns:
- an instance of
WarningReportModedescribing the reporting mode in use
-
setValidationLevel
Sets the
ValidationLevelto use for CALS table validation.A value of
ValidationLevel.STRICTwill cause theInvalidTableBehaviourmode to be used for any CALS invalidity. A value ofValidationLevel.RELAXEDmeans 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 theWarningReportModeregardless of the setting used here.- Parameters:
level- an instance ofValidationLeveldescribing the level to use
-
getValidationLevel
Returns the
ValidationLevelcurrent in use when validating CALS tables.- Returns:
- an instance of
ValidationLeveldescribing the level in use
-
setIgnoreColumnOrder
public void setIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether the
DocumentComparatorshould 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
Sets the
CalsColumnKeyingModeto use when comparing CALS tables.- Parameters:
mode- an instance ofCalsColumnKeyingModedescribing the keying mode to use
-
getCalsColumnKeyingMode
Returns the
CalsColumnKeyingModecurrently in use when comparing CALS tables.- Returns:
- an instance of
CalsColumnKeyingModedescribing the keying mode in use
-