Package org.apache.sis.metadata
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:
TableColumn.IDENTIFIER
- the property identifier as defined by the UML (if any).TableColumn.INDEX
- the index in the collection, or null if the property is not a collection.TableColumn.NAME
- the human-readable property name, inferred from the identifier and index.TableColumn.TYPE
- the base interface of property values.TableColumn.VALUE
- the property value.TableColumn.REMARKS
- remarks on the property value.
- Since:
- 0.3
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sis.util.collection.TreeTable
TreeTable.Node
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final List
<TableColumn<?>> The columns to be returned bygetColumns()
.private TreeNode
The root of the metadata tree.private static final long
For cross-version compatibility.(package private) final MetadataStandard
The metadata standard implemented by the metadata objects.(package private) final ValueExistencePolicy
The behavior of this tree table toward null or empty values. -
Constructor Summary
ConstructorsConstructorDescriptionTreeTableView
(MetadataStandard standard, Object metadata, Class<?> baseType, ValueExistencePolicy valuePolicy) Creates a tree table for the specified metadata object. -
Method Summary
Modifier and TypeMethodDescriptionfilter()
Returns the filter to use when formatting an instance of thisTreeTable
.private static boolean
filter
(TreeTable.Node node) Invoked during the formatting of a tree node for hiding the ISBN and ISSN identifiers of aCitation
.List
<TableColumn<?>> Returns the columns included in this tree table.getRoot()
Returns the root of this metadata tree.private void
Invoked on deserialization.toString()
Returns a string representation of this tree table.private void
Invoked on serialization.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
COLUMNS
The columns to be returned bygetColumns()
. -
root
The root of the metadata tree. Consider this field as final - it is modified only on deserialization byreadObject(ObjectInputStream)
. -
standard
The metadata standard implemented by the metadata objects. -
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 ofmetadata
interfaces to take in account.valuePolicy
- the behavior of this map toward null or empty values.
-
-
Method Details
-
getColumns
Returns the columns included in this tree table.- Specified by:
getColumns
in interfaceTreeTable
- Returns:
- the union of all table columns in every tree node.
- See Also:
-
getRoot
Returns the root of this metadata tree. -
toString
Returns a string representation of this tree table. The current implementation uses a shared instance ofTreeTableFormat
. This is okay for debugging or occasional usages. However for more extensive usages, developers are encouraged to create and configure their ownTreeTableFormat
instance. -
filter
Returns the filter to use when formatting an instance of thisTreeTable
. This filter will be combined with the filter that the user may specify by a call toTreeTableFormat.setNodeFilter(Predicate)
.- Specified by:
filter
in interfaceTreeFormatCustomization
- Returns:
- the tree node filter to use for the
TreeTable
instance being formatted.
-
filter
Invoked during the formatting of a tree node for hiding the ISBN and ISSN identifiers of aCitation
. Those identifiers will be formatted in theISBN
andISSN
properties instead. We apply this filtering for avoiding redundancies in the tree representation. -
writeObject
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
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.
-