Class AuthorityCodesReport.Row

Object
Row
All Implemented Interfaces:
Comparable<AuthorityCodesReport.Row>
Enclosing class:
AuthorityCodesReport

protected static class AuthorityCodesReport.Row extends Object implements Comparable<AuthorityCodesReport.Row>
A single row in the table produced by AuthorityCodesReport. Instances of this class are created by the AuthorityCodesReport.createRow(…) methods. Subclasses of AuthorityCodesReport can override those methods in order to modify the content of a row.

Every String fields in this class must be valid HTML. If some text is expected to print < or > characters, then those characters need to be escaped to their HTML entities.

Content of each Row instance is written in the following order:

  1. annotation if explicitly set (the default is none).
  2. code
  3. name
  4. remark

Other attributes (isSectionHeader, isDeprecated and hasError) are not directly written in the table, but affect their styling.

Since:
3.1
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    char
    A small symbol to put before the code and name, or 0 (the default) if none.
    The authority code in HTML.
    boolean
    true if an exception occurred while creating the identified object.
    boolean
    true if this authority code is deprecated, or false otherwise.
    boolean
    true if this row should actually be used as a section header.
    The object name in HTML, or null if none.
    A remark in HTML to display after the name, or null if none.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Row()
    Creates a new row with all fields initialized to null or false.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this row with the given one for order.
    Returns a string representation of this row, for debugging purpose only.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • code

      public String code
      The authority code in HTML.
    • name

      public String name
      The object name in HTML, or null if none. By default, this field is set to the value of IdentifiedObject.getName().getCode().

      Users can override AuthorityCodesReport.createRow(String, IdentifiedObject) if they wish to change the value of this field.

    • remark

      public String remark
      A remark in HTML to display after the name, or null if none. By default, this field is set to one of the following values:

      Users can override AuthorityCodesReport.createRow(String, IdentifiedObject) or AuthorityCodesReport.createRow(String, FactoryException) if they wish to change the value of this field.

    • annotation

      public char annotation
      A small symbol to put before the code and name, or 0 (the default) if none. Implementations can use this field for putting a mark before objects having some particular characteristics, for example a CRS having unusual axes order.
    • isSectionHeader

      public boolean isSectionHeader
      true if this row should actually be used as a section header. Users can insert rows with this flag set to true if they wish to split the large table is smaller sections.
    • isDeprecated

      public boolean isDeprecated
      true if this authority code is deprecated, or false otherwise.
    • hasError

      public boolean hasError
      true if an exception occurred while creating the identified object. If true, then the remark field will contains the exception localized message.
  • Constructor Details

    • Row

      public Row()
      Creates a new row with all fields initialized to null or false.
  • Method Details

    • compareTo

      public int compareTo(AuthorityCodesReport.Row o)
      Compares this row with the given one for order. The default implementation splits the code spaces (or scopes) from the codes using the ":" separator, then compares each elements. This method tries to compare the elements as numeric values if possible (i.e. 4326 is less than 27561). If the codes cannot be compared as numerical values, then they are compared as strings using a case-insensitive comparator.

      Subclasses can override this method if they want a different rows ordering.

      Specified by:
      compareTo in interface Comparable<AuthorityCodesReport.Row>
      Parameters:
      o - the other row to compare with this row.
      Returns:
      -1 for sorting this row before the given row, +1 for sorting it after, or 0 if the two rows have equal ordering.
    • toString

      public String toString()
      Returns a string representation of this row, for debugging purpose only.
      Overrides:
      toString in class Object
      Returns:
      an arbitrary string representation of this row.