Class Column
SearchType and the optional
per-column SearchOperatorSet.
Operator gating
A column's offerable operators are modeled by a single SearchOperatorSet, never a string allow-list or a
separate custom-operator map. A custom operator is simply a SearchOperator placed inside a set via
SearchOperatorSet.standard(), SearchOperatorSet.with(SearchOperator), or
SearchOperatorSet.of(SearchOperator...).
- Set absent (default): the column offers the entire type-applicable
standarduniverse (or, when resolved against a table, the table-level set — seeViewDef). - Set present (
operators(SearchOperatorSet)): the column's set entirely replaces the table-level set for this column; the effective operators are that set'stype-applicablemembers.
An operator not on the effective set is a reject (the popup marks it invalid), never a silent rewrite
— see offers(String).
Mutability
Deliberately mutable, like ViewDef and RegionDef: a Column is a server-side authoring
bean built up once via fluent setters while constructing a view definition, 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 TypeMethodDescriptionSets a CSS class applied to this column's cells.static ColumnStarts a new column definition.defaultVisible(boolean v) Sets whether this column starts visible.Resolves the effective operator set the header popup offers for this column, against the built-instandardset as the fallback default.effectiveOperators(SearchOperatorSet tableDefault) Resolves the effective operator set the header popup offers for this column, inheriting the specified table-level set when this column has none of its own.Sets the row-data interpolation template this column's rendered cell links to.label()Sets the human-readable column label.name()booleanWhether the named operator is on this column's effective set — i.e. whether the popup offers it (and accepts it rather than rejecting it as invalid).This column's own operator set, ornull if absent (inherit the table-level set).operators(SearchOperatorSet value) Sets this column's ownSearchOperatorSet— it entirely replaces the table-level set for this column.Sets this column's cell renderer from the compact"id:field"string sugar.Sets this column's cell renderer.booleanSerializes this column's effective search configuration to theVIEW_METAsearchblock: the wireSearchTypetoken plus one entry pereffective operator, each carrying the metadata the header popup renders.static JsonMapsearchMeta(String name, String searchTypeWire, List<String> operatorAllowList, List<Map<String, String>> customOperators) Builds the per-columnsearchblock for theVIEW_METAwire contract directly from author-catalog inputs, without the caller having to touch the search-engine beans.searchMeta(SearchOperatorSet tableDefault) Serializes this column's effective search configuration to theVIEW_METAsearchblock, inheriting the specified table-level operator set when this column has none of its own.searchType(SearchType value) Sets the column's value type, which governs both leaf semantics and the offerable built-in operators.Builds this column's catalog entry:keyandlabelplus the display (render,href,className,defaultVisible) and search (searchType,searchOperators,customOperators) metadata, flattened onto one entry, in the form thedatatablescard type resolves.toCatalogMap(SearchOperatorSet tableDefault) Builds this column's catalog entry liketoCatalogMap(), but emits the column's effective operator set: its own set if it has one, elsetableDefault.
-
Method Details
-
create
Starts a new column definition.- Parameters:
name- The column name (matches the row-data key). Must not benull or blank.- Returns:
- A new column, not searchable until a
searchType(SearchType)is set. - Throws:
IllegalArgumentException- Ifnameisnull or blank.
-
label
Sets the human-readable column label.- Parameters:
value- The label. Can benull .- Returns:
- This object.
-
searchType
Sets the column's value type, which governs both leaf semantics and the offerable built-in operators. A column with no search type is not searchable.- Parameters:
value- The value type. Can benull to mark the column non-searchable.- Returns:
- This object.
-
operators
Sets this column's ownSearchOperatorSet— it entirely replaces the table-level set for this column.- Parameters:
value- The operator set. Anull value clears it back to absent (inherit the table-level set, orSearchOperatorSet.standard()when there is none).- Returns:
- This object.
-
render
Sets this column's cell renderer from the compact"id:field"string sugar.- Parameters:
spec- The render-id string, e.g."tag:status". Must not benull or blank.- Returns:
- This object.
-
render
Sets this column's cell renderer.- Parameters:
value- The renderer. Can benull to unset.- Returns:
- This object.
-
href
Sets the row-data interpolation template this column's rendered cell links to.An
hrefwith norenderimpliesrender("linked"); the catalog entry (toCatalogMap()) carries that render. An explicit render always wins, whichever order the two are set in.- Parameters:
template- The href template, e.g."{incidentUrl}". Can benull to unset.- Returns:
- This object.
-
className
Sets a CSS class applied to this column's cells.- Parameters:
css- The class name(s). Can benull to unset.- Returns:
- This object.
-
defaultVisible
Sets whether this column starts visible.Defaults to
true ; onlyfalseis ever emitted bytoCatalogMap().A
falsevalue only hides the column when the client'scolumnConfig(juneau-config.js) is on; without it the column stays visible.- Parameters:
v- Whether the column starts visible.- Returns:
- This object.
-
toCatalogMap
Builds this column's catalog entry:keyandlabelplus the display (render,href,className,defaultVisible) and search (searchType,searchOperators,customOperators) metadata, flattened onto one entry, in the form thedatatablescard type resolves.searchOperatorsis a list of operator names andcustomOperatorsa list of{name,help}maps for the custom ones. Both are emitted only when this column has its ownoperator set; a column inheriting the table-level set emits justsearchType, and a column with no search type emits neither. SeetoCatalogMap(SearchOperatorSet)to resolve the table-level set into the entry.labelfalls back toname()when unset. A column with anhrefand norenderemitsrenderas thelinkedrenderer.- Returns:
- The catalog entry.
-
toCatalogMap
Builds this column's catalog entry liketoCatalogMap(), but emits the column's effective operator set: its own set if it has one, elsetableDefault.This is how a table-level set reaches the
datatablescard type, which reads operators per column. With no column set and anull tableDefault, onlysearchTypeis emitted.- Parameters:
tableDefault- The table-level operator set inherited by a column with none of its own. Can benull .- Returns:
- The catalog entry.
-
name
- Returns:
- The column name.
-
label
- Returns:
- The column label, or
null .
-
searchType
- Returns:
- The column value type, or
null if the column is not searchable.
-
operators
This column's own operator set, ornull if absent (inherit the table-level set).- Returns:
- The operator set, or
null .
-
searchable
- Returns:
true if this column has a search type (and is therefore searchable).
-
effectiveOperators
Resolves the effective operator set the header popup offers for this column, against the built-instandardset as the fallback default.- Returns:
- The effective operators, in the resolved set's order; empty when the column is not searchable.
-
effectiveOperators
Resolves the effective operator set the header popup offers for this column, inheriting the specified table-level set when this column has none of its own.- Parameters:
tableDefault- The table-level operator set to inherit when this column has none of its own. Can benull , in which caseSearchOperatorSet.standard()is used.- Returns:
- The effective operators, in the resolved set's order; empty when the column is not searchable.
-
offers
Whether the named operator is on this column's effective set — i.e. whether the popup offers it (and accepts it rather than rejecting it as invalid).- Parameters:
opName- The operator name, including the leading$. Can benull .- Returns:
true if the operator is offered for this column.
-
searchMeta
public static JsonMap searchMeta(String name, String searchTypeWire, List<String> operatorAllowList, List<Map<String, String>> customOperators) Builds the per-columnsearchblock for theVIEW_METAwire contract directly from author-catalog inputs, without the caller having to touch the search-engine beans.This is the entry point the chrome/authoring layer uses: it takes only the wire token, the optional allowed-operator names, and the custom operators as plain
{name,help}maps — so a chrome-only module that must not depend on the search engine can still emit a column's search block by calling here. Internally this builds a singleSearchOperatorSet: an allow-list becomesSearchOperatorSet.of(SearchOperator...)with exactly the named operators (customs preferred over same-named built-ins), while an absent allow-list becomesSearchOperatorSet.standard()with each custom appended viaSearchOperatorSet.with(SearchOperator).- Parameters:
name- The column name (row-data key). Must not benull or blank.searchTypeWire- The wireSearchTypetoken, ornull .operatorAllowList- The explicit allowed-operator names, ornull for the default (the full type-applicable universe).customOperators- Per-column custom operators as{name,help}maps; may benull or empty.- Returns:
- The
{type, operators:[...]}block, ornull whensearchTypeWirenames no known type (a non-searchable column emits no search block).
-
searchMeta
Serializes this column's effective search configuration to theVIEW_METAsearchblock: the wireSearchTypetoken plus one entry pereffective operator, each carrying the metadata the header popup renders.help is present only for custom operators; the popup supplies built-in help text fromjuneau-search.js .- Returns:
- The
{type, operators:[{name,help,minArgs,maxArgs,combinator,custom}]}block, ornull if this column is not searchable.
-
searchMeta
Serializes this column's effective search configuration to theVIEW_METAsearchblock, inheriting the specified table-level operator set when this column has none of its own.- Parameters:
tableDefault- The table-level operator set to inherit when this column has none of its own. Can benull , in which caseSearchOperatorSet.standard()is used.- Returns:
- The
{type, operators:[{name,help,minArgs,maxArgs,combinator,custom}]}block, ornull if this column is not searchable.
-