Package ro.sync.ecss.extensions.commons
Class AbstractDocumentTypeHelper
java.lang.Object
ro.sync.ecss.extensions.commons.AbstractDocumentTypeHelper
- All Implemented Interfaces:
AuthorTableHelper
- Direct Known Subclasses:
CALSDocumentTypeHelper
,DITARelTableDocumentTypeHelper
,DITASimpleTableDocumentTypeHelper
,TEIDocumentTypeHelper
,XHTMLDocumentTypeHelper
@API(type=INTERNAL,
src=PUBLIC)
public abstract class AbstractDocumentTypeHelper
extends Object
implements AuthorTableHelper
Abstract implementation of the document type helper.
-
Field Summary
Fields inherited from interface ro.sync.ecss.extensions.commons.table.operations.AuthorTableHelper
TYPE_CELL, TYPE_ROW, TYPE_TABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]
Get a list of allowed cell attributes to copy when creating a new row based on an older one.protected abstract String[]
Returns the possible local names of the elements that represents a table cell.getTableElementForDeletion
(AuthorNode element) When we delete all the rows or all the columns of a table, we also want to delete the entire table element.protected abstract String[]
Returns the possible local names of the elements that represents a table.protected abstract String[]
Return the possible local names of the elements that represent a table row.boolean
isColspec
(AuthorNode node) Check if a node is a colspec node.boolean
isContentReference
(AuthorNode node) Check if this node references another node which should replace it entirely.protected boolean
isElement
(AuthorNode node, String elemLocalName) Test if a given node is an element and has the a specific local name.boolean
isTable
(AuthorNode node) Check if anAuthorNode
is a table node.boolean
isTableCell
(AuthorNode node) Check if anAuthorNode
is a table cell node.boolean
isTableRow
(AuthorNode node) Check if anAuthorNode
is a table row node.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ro.sync.ecss.extensions.commons.table.operations.AuthorTableHelper
checkTableColSpanIsDefined, getIgnoredCellIDAttributes, getIgnoredColumnAttributes, getIgnoredRowAttributes, getTableCellSpanProvider, updateTableColSpan, updateTableColumnNumber, updateTableRowNumber, updateTableRowSpan
-
Constructor Details
-
AbstractDocumentTypeHelper
public AbstractDocumentTypeHelper()
-
-
Method Details
-
isElement
Test if a given node is an element and has the a specific local name.- Parameters:
node
- TheAuthorNode
to be checked.elemLocalName
- The local name of the element.- Returns:
true
if the givenAuthorNode
is an element and its local name matches the given string.
-
isTableCell
Description copied from interface:AuthorTableHelper
Check if anAuthorNode
is a table cell node.- Specified by:
isTableCell
in interfaceAuthorTableHelper
- Parameters:
node
- TheAuthorNode
to be checked.- Returns:
true
if the node is a table cell node,false
otherwise.- See Also:
-
isTable
Description copied from interface:AuthorTableHelper
Check if anAuthorNode
is a table node.- Specified by:
isTable
in interfaceAuthorTableHelper
- Parameters:
node
- TheAuthorNode
to be checked.- Returns:
true
if the node is a table node,false
otherwise.- See Also:
-
isTableRow
Description copied from interface:AuthorTableHelper
Check if anAuthorNode
is a table row node.- Specified by:
isTableRow
in interfaceAuthorTableHelper
- Parameters:
node
- TheAuthorNode
to be checked.- Returns:
true
if the node is a table row node,false
otherwise.- See Also:
-
getTableElementForDeletion
Description copied from interface:AuthorTableHelper
When we delete all the rows or all the columns of a table, we also want to delete the entire table element.
OBS: For CALS tables we don't want to delete only the "tgroup", but the parent table element itself.- Specified by:
getTableElementForDeletion
in interfaceAuthorTableHelper
- Parameters:
element
- the node whose parent table we are looking for.- Returns:
- the table element to be deleted.
- See Also:
-
getTableCellElementNames
Returns the possible local names of the elements that represents a table cell.- Returns:
- The local names of the elements that represents a table cell.
Not
null
.
-
getTableRowElementNames
Return the possible local names of the elements that represent a table row.- Returns:
- The local names of the elements that represent a table row.
-
getTableElementLocalName
Returns the possible local names of the elements that represents a table.- Returns:
- The local names of the elements that represents a table.
-
getAllowedCellAttributesToCopy
Get a list of allowed cell attributes to copy when creating a new row based on an older one.- Returns:
- a list of allowed cell attributes to copy when creating a new row.
If it returns
null
, the list of ignored attributes will be used by default.
-
isContentReference
Check if this node references another node which should replace it entirely. This is used in the tables to replace conreffed table rows entirely- Parameters:
node
- The node- Returns:
true
if this node references another node which should replace it entirely.
-
isColspec
Check if a node is a colspec node.- Specified by:
isColspec
in interfaceAuthorTableHelper
- Parameters:
node
- The node.- Returns:
true
if a node is a colspec node.
-