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.
  • Constructor Details

    • AbstractDocumentTypeHelper

      public AbstractDocumentTypeHelper()
  • Method Details

    • isElement

      protected boolean isElement(AuthorNode node, String elemLocalName)
      Test if a given node is an element and has the a specific local name.
      Parameters:
      node - The AuthorNode to be checked.
      elemLocalName - The local name of the element.
      Returns:
      true if the given AuthorNode is an element and its local name matches the given string.
    • isTableCell

      public boolean isTableCell(AuthorNode node)
      Description copied from interface: AuthorTableHelper
      Check if an AuthorNode is a table cell node.
      Specified by:
      isTableCell in interface AuthorTableHelper
      Parameters:
      node - The AuthorNode to be checked.
      Returns:
      true if the node is a table cell node, false otherwise.
      See Also:
    • isTable

      public boolean isTable(AuthorNode node)
      Description copied from interface: AuthorTableHelper
      Check if an AuthorNode is a table node.
      Specified by:
      isTable in interface AuthorTableHelper
      Parameters:
      node - The AuthorNode to be checked.
      Returns:
      true if the node is a table node, false otherwise.
      See Also:
    • isTableRow

      public boolean isTableRow(AuthorNode node)
      Description copied from interface: AuthorTableHelper
      Check if an AuthorNode is a table row node.
      Specified by:
      isTableRow in interface AuthorTableHelper
      Parameters:
      node - The AuthorNode to be checked.
      Returns:
      true if the node is a table row node, false otherwise.
      See Also:
    • 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 interface AuthorTableHelper
      Parameters:
      element - the node whose parent table we are looking for.
      Returns:
      the table element to be deleted.
      See Also:
    • getTableCellElementNames

      protected abstract 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 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 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 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 interface AuthorTableHelper
      Parameters:
      node - The node.
      Returns:
      true if a node is a colspec node.