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.
Constructor and Description |
---|
CalsTableConfiguration()
Constructs a new
CalsTableConfiguration instance. |
Modifier and Type | Method and Description |
---|---|
CalsColumnKeyingMode |
getCalsColumnKeyingMode()
Returns the
CalsColumnKeyingMode currently in use when comparing CALS tables. |
InvalidTableBehaviour |
getInvalidTableBehaviour()
Returns the current behavior in use when inputs contain invalid CALS tables.
|
ValidationLevel |
getValidationLevel()
Returns the
ValidationLevel current in use when validating CALS tables. |
WarningReportMode |
getWarningReportMode()
Returns the
WarningReportMode in use when invalid CALS tables are encountered. |
boolean |
isIgnoreColumnOrder()
Determines whether ignoring CALS table column order is enabled.
|
boolean |
isProcessTables()
Determines whether CALS table processing is enabled.
|
void |
setCalsColumnKeyingMode(CalsColumnKeyingMode mode)
Sets the
CalsColumnKeyingMode to use when comparing CALS tables. |
void |
setIgnoreColumnOrder(boolean ignoreColumnOrder)
Sets whether the
DocumentComparator should ignore CALS table column order. |
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.
|
void |
setProcessTables(boolean value)
Specifies whether to apply CALS table processing.
|
void |
setValidationLevel(ValidationLevel level)
Sets the
ValidationLevel to use for CALS table validation. |
void |
setWarningReportMode(WarningReportMode mode)
Specifies how CALS table invalidity warnings should be reported.
|
public CalsTableConfiguration()
CalsTableConfiguration
instance.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
value
- a boolean value to enable CALS table processingpublic boolean isProcessTables()
Determines whether CALS table processing is enabled.
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
behaviour
- the value to set for the InvalidTableBehaviour parameterIllegalArgumentException
- if the value is nullInvalidTableBehaviour
public InvalidTableBehaviour getInvalidTableBehaviour()
InvalidTableBehaviour
describing the behavior in usepublic void setWarningReportMode(WarningReportMode mode)
mode
- the WarningReportMode
to use when invalid CALS tables are encounteredpublic WarningReportMode getWarningReportMode()
WarningReportMode
in use when invalid CALS tables are encountered.WarningReportMode
describing the reporting mode in usepublic 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.
level
- an instance of ValidationLevel
describing the level to usepublic ValidationLevel getValidationLevel()
Returns the ValidationLevel
current in use when validating CALS tables.
ValidationLevel
describing the level in usepublic void setIgnoreColumnOrder(boolean ignoreColumnOrder)
Sets whether the DocumentComparator
should ignore CALS table column order.
ignoreColumnOrder
- whether to ignore CALS table column orderpublic boolean isIgnoreColumnOrder()
Determines whether ignoring CALS table column order is enabled.
public void setCalsColumnKeyingMode(CalsColumnKeyingMode mode)
Sets the CalsColumnKeyingMode
to use when comparing CALS tables.
mode
- an instance of ColumnKeyingMode
describing the keying mode to usepublic CalsColumnKeyingMode getCalsColumnKeyingMode()
Returns the CalsColumnKeyingMode
currently in use when comparing CALS tables.
CalsColumnKeyingMode
describing the keying mode in useCopyright © 2023 Deltaman Group Ltd. All Rights Reserved.