Class HtmlTableConfiguration
Specifies configuration options for HTML table comparison. These configuration options can be specified on a
DocumentComparator to configure its behaviour when comparing tables.
- Since:
- 10.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theHtmlColumnKeyingModecurrently in use when comparing HTML tables.Returns the current behaviour in use when inputs contain invalid HTML tables.Returns theValidationLevelcurrent in use when validating HTML tables.Returns theWarningReportModein use when invalid HTML tables are encountered.booleanDetermines whether ignoring HTML table column order is enabled.booleanReturns true if markTableCellSpanExtentChanges feature is on, otherwise false.booleanDetermines whether HTML table column specification is normalized.booleanDetermines whether HTML table processing is enabled.voidSets theHtmlColumnKeyingModeto use when comparing HTML tables.voidsetIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether theDocumentComparatorshould ignore HTML table column order.voidsetInvalidTableBehaviour(InvalidTableBehaviour behaviour) Sets the behaviour to use when inputs contain invalid HTML tables.voidsetMarkTableCellSpanExtentChanges(boolean value) Sets the markTableCellSpanExtentChanges feature on or off.voidsetNormalizeTable(boolean value) Sets whether theDocumentComparatorshould normalize the specification of columns in HTML tables.voidsetProcessTables(boolean value) Sets whether theDocumentComparatorshould process HTML tables.voidSets theValidationLevelto use for HTML table validation.voidSpecifies how HTML table invalidity warnings should be reported.
-
Constructor Details
-
HtmlTableConfiguration
public HtmlTableConfiguration()Constructs a newHtmlTableConfigurationinstance.
-
-
Method Details
-
setProcessTables
public void setProcessTables(boolean value) Sets whether the
DocumentComparatorshould process HTML tables.HTML table processing is recommended as it will perform sophisticated processing when comparing two HTML tables to ensure that the resulting HTML table is valid.
- Parameters:
value- whether to use HTML table processing
-
isProcessTables
public boolean isProcessTables()Determines whether HTML table processing is enabled.
- Returns:
- a boolean describing the enabled state of HTML table processing
-
setValidationLevel
Sets the
ValidationLevelto use for HTML table validation.A value of
ValidationLevel.STRICTwill cause theInvalidTableBehaviourmode to be used for any HTML invalidity. A value ofValidationLevel.RELAXEDmeans that invalidities which are known to have no effect on HTML processing will not prevent HTML 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 HTML tables.- Returns:
- an instance of
ValidationLeveldescribing the level in use
-
setInvalidTableBehaviour
Sets the behaviour to use when inputs contain invalid HTML tables.- Parameters:
behaviour- an instance ofInvalidTableBehaviourspecifying the behaviour to use when invalid HTML tables are encountered
-
getInvalidTableBehaviour
Returns the current behaviour in use when inputs contain invalid HTML tables.- Returns:
- an instance of
InvalidTableBehaviourdescribing the behaviour in use
-
setWarningReportMode
Specifies how HTML table invalidity warnings should be reported.- Parameters:
mode- theWarningReportModeto use when invalid HTML tables are encountered
-
getWarningReportMode
Returns theWarningReportModein use when invalid HTML tables are encountered.- Returns:
- an instance of
WarningReportModedescribing the reporting mode in use
-
setNormalizeTable
public void setNormalizeTable(boolean value) Sets whether the
DocumentComparatorshould normalize the specification of columns in HTML tables.This setting is recommended when there is a difference between inputs of specifying columns, e.g. if one uses just <colgroup> and another uses <col> without <colgroup>.
- Parameters:
value- whether to normalize HTML Table column specification
-
isNormalizeTable
public boolean isNormalizeTable()Determines whether HTML table column specification is normalized.
- Returns:
- a boolean describing the enabled state of normalization of HTML Table column specification
-
setIgnoreColumnOrder
public void setIgnoreColumnOrder(boolean ignoreColumnOrder) Sets whether the
DocumentComparatorshould ignore HTML table column order.- Parameters:
ignoreColumnOrder- whether to ignore HTML table column order
-
isIgnoreColumnOrder
public boolean isIgnoreColumnOrder()Determines whether ignoring HTML table column order is enabled.
- Returns:
- a boolean describing whether the HTML table column order is ignored
-
setHtmlColumnKeyingMode
Sets the
HtmlColumnKeyingModeto use when comparing HTML tables.- Parameters:
mode- an instance ofHtmlColumnKeyingModedescribing the keying mode to use
-
getHtmlColumnKeyingMode
Returns the
HtmlColumnKeyingModecurrently in use when comparing HTML tables.- Returns:
- an instance of
HtmlColumnKeyingModedescribing the keying mode in use
-
setMarkTableCellSpanExtentChanges
public void setMarkTableCellSpanExtentChanges(boolean value) Sets the markTableCellSpanExtentChanges feature on or off. When set, a deltaxml:span-extent-changed attribute is added to table cell elements that have changed spans.- Parameters:
value- A boolean value to set this feature.
-
isMarkTableCellSpanExtentChanges
public boolean isMarkTableCellSpanExtentChanges()Returns true if markTableCellSpanExtentChanges feature is on, otherwise false.- Returns:
- the current setting for markTableCellSpanExtentChanges.
-