Package org.opengis.test.report
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 byAuthorityCodesReport
. Instances of this class are created by theAuthorityCodesReport.createRow(…)
methods. Subclasses ofAuthorityCodesReport
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:annotation
if explicitly set (the default is none).code
name
remark
Other attributes (
isSectionHeader
,isDeprecated
andhasError
) are not directly written in the table, but affect their styling.
-
-
Field Summary
Fields Modifier and Type Field Description char
annotation
String
code
The authority code in HTML.boolean
hasError
true
if an exception occurred while creating the identified object.boolean
isDeprecated
true
if this authority code is deprecated, orfalse
otherwise.boolean
isSectionHeader
true
if this row should actually be used as a section header.String
name
The object name in HTML, ornull
if none.String
remark
A remark in HTML to display after the name, ornull
if none.
-
Constructor Summary
Constructors Constructor Description Row()
Creates a new row with all fields initialized tonull
orfalse
.
-
Method Summary
Modifier and Type Method Description int
compareTo(AuthorityCodesReport.Row o)
Compares this row with the given one for order.String
toString()
Returns a string representation of this row, for debugging purpose only.
-
-
-
Field Detail
-
name
public String name
The object name in HTML, ornull
if none. By default, this field is set to the value ofIdentifiedObject.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, ornull
if none. By default, this field is set to one of the following values:- If the object creation was successful, the
IdentifiedObject.getRemarks()
localized to the report locale. - Otherwise, the
FactoryException
localized message.
Users can override
AuthorityCodesReport.createRow(String, IdentifiedObject)
orAuthorityCodesReport.createRow(String, FactoryException)
if they wish to change the value of this field. - If the object creation was successful, the
-
annotation
public char annotation
-
isSectionHeader
public boolean isSectionHeader
true
if this row should actually be used as a section header. Users can insert rows with this flag set totrue
if they wish to split the large table is smaller sections.
-
isDeprecated
public boolean isDeprecated
true
if this authority code is deprecated, orfalse
otherwise.
-
-
Constructor Detail
-
Row
public Row()
Creates a new row with all fields initialized tonull
orfalse
.
-
-
Method Detail
-
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 can not 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 interfaceComparable<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.
-
-