java.lang.Object
ro.sync.ecss.extensions.commons.table.support.CALSColSpec

@API(type=INTERNAL, src=PUBLIC) public class CALSColSpec extends Object
The column specification for a CALS table model (e.g. DocBook or DITA tables).
  • Constructor Details

    • CALSColSpec

      public CALSColSpec(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, String colWidth, Boolean colSep, Boolean rowSep)
      Constructor.
      Parameters:
      indexInDocument - Index in colspec elements list.
      colNumber - The number of the column. It is 1 based.
      colNumberSpecified - true if the column number was specified as an attribute
      colName - The name of the column.
      colWidth - The string representation of the column width as described in the WidthRepresentation.
      colSep - true if the column separators are needed for that column, false if not, null if the framework default should apply. For instance Docbook has the colsep on true by default, while DITA on false.
      rowSep - true if the row separators are needed for that column, false if not, null if the framework default should apply. For instance Docbook has the rowsep on true by default, while DITA on false.
    • CALSColSpec

      public CALSColSpec(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, WidthRepresentation colWidth)
      Constructor. The rowsep and colsep are set to null, i.e. the document type default.
      Parameters:
      indexInDocument - Index in colspec elements list.
      colNumber - The number of this column. It is 1 based.
      colNumberSpecified - true if the column number was specified as an attribute
      colName - The name of this column.
      colWidth - The column width representation.
  • Method Details

    • getColSep

      public Boolean getColSep()
      Tests the presence of the column separator.
      Returns:
      true if the separator should be painted at the right of the cell, false if no separator is needed, or null if the default specified by the document type should be applied. For instance in Docbook, the default value is true while in DITA is false. If the cell is the last in the row, this value is disregarded.
    • getRowSep

      public Boolean getRowSep()
      Tests the presence of the row separator.
      Returns:
      true if the separator should be painted below the cell, false if no separator is needed, or null if the default specified by the document type should be applied. For instance in Docbook, the default value is true while in DITA is false. If the cell is the in the last row, this value is disregarded.
    • isColNumberSpecified

      public boolean isColNumberSpecified()
      Returns:
      Returns the colNumberSpecified.
    • getIndexInDocument

      public int getIndexInDocument()
      Returns:
      Returns the indexInDocument.
    • getColumnNumber

      public int getColumnNumber()
      Returns:
      The column number. It is 1 based.
    • getColumnName

      public String getColumnName()
      Returns:
      The name of the column.
    • getColWidth

      public WidthRepresentation getColWidth()
      Returns:
      Returns the column width representation.
    • toString

      public String toString()
      Creates a String representation of the column specification.
      Overrides:
      toString in class Object
      See Also:
    • createXMLFragment

      public String createXMLFragment(String ns)
      Creates the XML fragment corresponding to the column specification obtained from the colNumber, colName and colWidth fields.
      The general format of the generated fragment is:

      <colspec colnum="integer_value" colname="string_value" colwidth="string_value" xmlns="URI"/>
      Parameters:
      ns - The namespace URI of the table element. It can be null.
      Returns:
      The XML fragment corresponding to the column specification.
    • setColWidth

      public void setColWidth(WidthRepresentation colWidth)
      Set the new WidthRepresentation corresponding to the column specification.
      Parameters:
      colWidth - The column width to be set.
    • getAlign

      public String getAlign()
      Get the align value specified on the colspec.
      Returns:
      Returns the align value.
    • setAlign

      public void setAlign(String align)
      Set the align value specified on the colspec.
      Parameters:
      align - The textAlign to set.