Class ViewDef
Column definitions carrying each column's search
configuration. This is the bean the VIEW_META search block is serialized from.
A view may also carry a table-level SearchOperatorSet: it is inherited by every column that
does not supply its own set (see Column.effectiveOperators(SearchOperatorSet) and
Column.searchMeta(SearchOperatorSet)). A column that supplies its own set entirely replaces the
table-level set for that column.
Mutability
Deliberately mutable, like Column and RegionDef: a ViewDef is a server-side authoring
bean built up once via fluent setters and column(Column) calls while constructing a view,
not an immutable value object. Callers must not mutate one concurrently from more than one
thread, and must not reuse one across requests unless every request treats it as read-only after construction.
Example:
See Also:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionAdds a column definition, in order.columns()The column definitions, in insertion order.static ViewDefStarts a new view definition.findColumn(String name) Looks up a column by name.id()This view's table-level operator set, ornull if absent (columns without their own set fall back toSearchOperatorSet.standard()).operators(SearchOperatorSet value) Sets the table-levelSearchOperatorSet— inherited by every column that does not supply its own set.
-
Method Details
-
create
Starts a new view definition.- Parameters:
id- The view id (matches the datatable's id on the page). Must not benull or blank.- Returns:
- A new, empty view definition.
- Throws:
IllegalArgumentException- Ifidisnull or blank.
-
column
Adds a column definition, in order.- Parameters:
value- The column. Must not benull .- Returns:
- This object.
- Throws:
IllegalArgumentException- Ifvalueisnull .
-
operators
Sets the table-levelSearchOperatorSet— inherited by every column that does not supply its own set.- Parameters:
value- The operator set. Can benull to clear it (columns without their own set then fall back toSearchOperatorSet.standard()).- Returns:
- This object.
-
id
- Returns:
- The view id.
-
columns
The column definitions, in insertion order.- Returns:
- An unmodifiable list of the columns.
-
findColumn
Looks up a column by name.- Parameters:
name- The column name. Can benull .- Returns:
- The column, or
null if no column has that name.
-
operators
This view's table-level operator set, ornull if absent (columns without their own set fall back toSearchOperatorSet.standard()).- Returns:
- The operator set, or
null .
-