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 java.lang.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 Constructor Description AbstractDocumentTypeHelper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getAllowedCellAttributesToCopy()
Get a list of allowed cell attributes to copy when creating a new row based on an older one.protected abstract java.lang.String[]
getTableCellElementNames()
Returns the possible local names of the elements that represents a table cell.AuthorNode
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 java.lang.String[]
getTableElementLocalName()
Returns the possible local names of the elements that represents a table.protected abstract java.lang.String[]
getTableRowElementNames()
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, java.lang.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
-
-
-
-
Method Detail
-
isElement
protected boolean isElement(AuthorNode node, java.lang.String elemLocalName)
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
public boolean isTableCell(AuthorNode node)
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:
AuthorTableHelper.isTableCell(ro.sync.ecss.extensions.api.node.AuthorNode)
-
isTable
public boolean isTable(AuthorNode node)
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:
AuthorTableHelper.isTable(ro.sync.ecss.extensions.api.node.AuthorNode)
-
isTableRow
public boolean isTableRow(AuthorNode node)
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:
AuthorTableHelper.isTableRow(ro.sync.ecss.extensions.api.node.AuthorNode)
-
getTableElementForDeletion
public AuthorNode getTableElementForDeletion(AuthorNode element)
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:
AuthorTableHelper.getTableElementForDeletion(ro.sync.ecss.extensions.api.node.AuthorNode)
-
getTableCellElementNames
protected abstract java.lang.String[] 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
protected abstract java.lang.String[] 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
protected abstract java.lang.String[] 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
public java.lang.String[] 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
public boolean isContentReference(AuthorNode node)
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
public boolean isColspec(AuthorNode node)
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.
-
-