Class TreeTableView

java.lang.Object
org.apache.sis.metadata.TreeTableView
All Implemented Interfaces:
Serializable, TreeFormatCustomization, TreeTable

final class TreeTableView extends Object implements TreeTable, TreeFormatCustomization, Serializable
A tree table view over a metadata object. The tree table is made of the following columns:
Since:
0.3
Version:
1.0
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • COLUMNS

      static final List<TableColumn<?>> COLUMNS
      The columns to be returned by getColumns().
    • root

      private transient TreeNode root
      The root of the metadata tree. Consider this field as final - it is modified only on deserialization by readObject(ObjectInputStream).
    • standard

      final MetadataStandard standard
      The metadata standard implemented by the metadata objects.
    • valuePolicy

      final ValueExistencePolicy valuePolicy
      The behavior of this tree table toward null or empty values.
  • Constructor Details

    • TreeTableView

      TreeTableView(MetadataStandard standard, Object metadata, Class<?> baseType, ValueExistencePolicy valuePolicy)
      Creates a tree table for the specified metadata object.
      Parameters:
      standard - the metadata standard implemented by the given metadata.
      metadata - the metadata object to wrap.
      baseType - base type of metadata interfaces to take in account.
      valuePolicy - the behavior of this map toward null or empty values.
  • Method Details

    • getColumns

      public List<TableColumn<?>> getColumns()
      Returns the columns included in this tree table.
      Specified by:
      getColumns in interface TreeTable
      Returns:
      the union of all table columns in every tree node.
      See Also:
    • getRoot

      public TreeTable.Node getRoot()
      Returns the root of this metadata tree.
      Specified by:
      getRoot in interface TreeTable
      Returns:
      the root node of the tree.
    • toString

      public String toString()
      Returns a string representation of this tree table. The current implementation uses a shared instance of TreeTableFormat. This is okay for debugging or occasional usages. However for more extensive usages, developers are encouraged to create and configure their own TreeTableFormat instance.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this tree table.
    • filter

      public Predicate<TreeTable.Node> filter()
      Returns the filter to use when formatting an instance of this TreeTable. This filter will be combined with the filter that the user may specify by a call to TreeTableFormat.setNodeFilter(Predicate).
      Specified by:
      filter in interface TreeFormatCustomization
      Returns:
      the tree node filter to use for the TreeTable instance being formatted.
    • filter

      private static boolean filter(TreeTable.Node node)
      Invoked during the formatting of a tree node for hiding the ISBN and ISSN identifiers of a Citation. Those identifiers will be formatted in the ISBN and ISSN properties instead. We apply this filtering for avoiding redundancies in the tree representation.
    • writeObject

      private void writeObject(ObjectOutputStream out) throws IOException
      Invoked on serialization. Write the metadata object instead of the root node.
      Parameters:
      out - the output stream where to serialize this object.
      Throws:
      IOException - if an I/O error occurred while writing.
    • readObject

      private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
      Invoked on deserialization. Recreate the root node from the metadata object.
      Parameters:
      in - the input stream from which to deserialize an object.
      Throws:
      IOException - if an I/O error occurred while reading or if the stream contains invalid data.
      ClassNotFoundException - if the class serialized on the stream is not on the classpath.