Interface Component<C extends Component<C>>
- All Superinterfaces:
Comparable<C>
,Copyable<C>
,Serializable
- All Known Subinterfaces:
ActionGrid<G>
,ActionView<V>
,AugmentableView<V>
,BuilderFieldSource<D>
,CollapsibleGroup<G>
,Column<C>
,ConditionalColumn<C>
,ControlGroup<G>
,CreateEntityView<V>
,CustomAttributesGridField<F>
,CustomCssComponent<C>
,DateColumn<C>
,DateField<F>
,Dependent<D>
,DerivedColumn<C>
,DerivedField<F>
,DerivedSelectField<F>
,DerivedUrlField<F>
,DynamicColumn<C>
,DynamicField<F>
,EmbeddedListColumn<C>
,EntityBrowseView<V>
,EntityFormView<V>
,EntityGridView<V>
,EntityView<V>
,EnumColumn<C>
,EnumSwitchField<F>
,ExportGrid<G>
,ExportHistoryEntityGridView<V>
,ExportHistoryGrid<G>
,ExportHistoryGridExternal<E>
,External<E>
,FetchEntity<C>
,FetchGrid<G>
,Field<F>
,FieldArrayBlockField<F>
,FieldArrayField<F>
,FieldArrayGridField<F>
,FileInputField<F>
,Filterable<D>
,FilterableGrid<G>
,Form<F>
,FormComponent<C>
,FormView<V>
,Grid<G>
,GridExternal<E>
,GridView<V>
,Group<G>
,ImportGrid<G>
,InlineGroup<G>
,IntegerField<F>
,LinkColumn<C>
,LinkExternal<E>
,LinkGroup<G>
,LookupField<F>
,LookupFieldModal<V>
,Message<M>
,MoneyColumn<C>
,MoneyField<F>
,Orderable<R>
,PageableFetch<C>
,PhoneField<F>
,Pollable<G>
,PreviewableView<V>
,ProgressColumn<C>
,QueryBuilderField<F>
,ResidentGridField<F>
,ResidentMapField<F>
,ResourceGrid<G>
,RsqlRuleColumn<C>
,RuleBuilderField<F>
,Selectable<S>
,SelectField<F>
,SelectTargetEntityFormView<V>
,SelectTargetEntityGridView<V>
,SortableGrid<G>
,SpelRuleColumn<C>
,ThumbnailColumn<C>
,Trackable<T>
,Tree<T>
,TreeExternal<E>
,TreeGridView<V>
,TreeView<V>
,UpdateEntityView<V>
,View<V>
- All Known Implementing Classes:
AbstractColumn
,AbstractComponent
,AbstractExternal
,AbstractField
,AbstractFormComponent
,AbstractGroup
,AbstractMessage
,AbstractSelectTargetEntityFormView
,AbstractView
,DefaultBasicGroup
,DefaultCollapsibleGroup
,DefaultColumn
,DefaultConditionalColumn
,DefaultControlGroup
,DefaultCreateEntityLongFormView
,DefaultCreateEntityView
,DefaultCustomAttributesGridField
,DefaultDateColumn
,DefaultDateField
,DefaultDerivedColumn
,DefaultDerivedField
,DefaultDerivedSelectField
,DefaultDerivedUrlField
,DefaultDynamicColumn
,DefaultDynamicField
,DefaultEmbeddedListColumn
,DefaultEntityBrowseView
,DefaultEntityFormView
,DefaultEntityGridView
,DefaultEnumArrayColumn
,DefaultEnumColumn
,DefaultEnumSwitchField
,DefaultExportHistoryEntityGridView
,DefaultExportHistoryGridExternal
,DefaultExternal
,DefaultField
,DefaultFieldArrayBlockField
,DefaultFieldArrayGridField
,DefaultFileInputField
,DefaultFormView
,DefaultGridExternal
,DefaultGroup
,DefaultInlineGroup
,DefaultIntegerField
,DefaultLinkColumn
,DefaultLinkExternal
,DefaultLinkGroup
,DefaultLookupField
,DefaultLookupFieldModal
,DefaultMessage
,DefaultMoneyColumn
,DefaultMoneyField
,DefaultPhoneField
,DefaultProgressColumn
,DefaultQueryBuilderField
,DefaultResidentGridField
,DefaultResidentMapField
,DefaultRSQLRuleColumn
,DefaultRuleBuilderField
,DefaultSelectField
,DefaultSelectTargetEntityGridView
,DefaultSpelRuleColumn
,DefaultThumbnailColumn
,DefaultTreeExternal
,DefaultTreeGridView
,DefaultTreeView
,DefaultUpdateEntityLongFormView
,DefaultUpdateEntityView
Represents the metadata of a component. Component metadata is interpreted by the client
application in order to render a user interface. Metadata provides the application with
configuration detailing how a component should look and behave.
This specification is a representation of the most basic component metadata. There are many extensions of this base specification that include additional properties and helper methods to create a more guided experience when building various components.
There are several core extensions of this specification that represent distinct component
classifications. View
specifications are used for representing view components.
Field
, External
, and Group
specifications all extend
FormComponent
and are used for representing different types of components rendered within
forms. Various extensions of these core specifications exist that serve as a guide when creating
metadata for more complicated components.
- Author:
- Nick Crum (ncrum)
-
Method Summary
Modifier and TypeMethodDescriptiondefault C
Adds an action using the action's ID as the key.default C
Adds an action at the given key.default C
addComponent
(String key, Component<?> component) Primary method of adding a child component.default C
addEndpoint
(Endpoint<?> endpoint) Adds the provided endpoint to this component.default C
addEndpoint
(String type, Endpoint<?> endpoint) Adds the provided endpoint with the given type to this component.default C
Executes the provided function with this component as an argument.default C
Adds an attributes with the provided key and value.default C
augmentationKey
(String augmentationKey) Sets the augmentation key of this component.default C
classifier
(String classifier) Sets the classifier of this component.default C
Clears the current conditions on this component.default C
Clears the existing set of endpoints.default C
conditional
(Conditional<?>... conditionals) Adds one or more conditions to this component.default C
conditionals
(List<Conditional<?>> conditionals) Adds one or more conditions to this component.default C
description
(InternationalizedMessage description) Sets the description message for this component.default C
description
(String descriptionKey) Sets the description message key for this component.findAction
(String key) Finds the action at the given key.findAction
(Predicate<Action<?>> predicate) Retrieves a single action matching the given predicate.findActions
(Predicate<Action<?>> predicate) Retrieves a list of actions matching the given predicate.findAttribute
(String key) Finds the attribute at the given key.default <T> Optional<T>
findAttribute
(String key, Class<T> type) Finds the attribute at the given key.findComponent
(String key) Finds the component stored at the given key.findComponent
(Predicate<Component<?>> predicate) Retrieves a single child component that matches the given predicate.findComponents
(Predicate<Component<?>> predicate) Retrieves a list of child components that match the given predicate.findEndpoint
(String type) Finds the endpoint stored at the given type.findEndpoint
(String type, Class<T> clazz) Finds the endpoint stored at the given type.findEndpoint
(Predicate<Endpoint<?>> predicate) Retrieves a single endpoint matching the given predicate.findEndpoints
(Predicate<Endpoint<?>> predicate) Retrieves a list of endpoints that match the given predicate.default Component<?>
Alias forgetComponent(String)
.default <T extends Component<T>>
TAlias forgetComponent(String, Class)
.default Action<?>
Returns the action at the provided key.default <T extends Action<T>>
TReturns the action at the provided key with the given type.A key-value map of actions used for managing the actions of this component.default Collection<Action<?>>
The serializable, sorted list of actions.default Object
getAttribute
(String key) Retrieves the attribute at the given key.default <A> A
getAttribute
(String key, Class<A> clazz) Retrieves the attribute at the given key and casts to the provided type.A key-value map used to provide additional metadata beyond the first-class properties.A unique identifier for the component within its full component tree.An indicator of the class of components this component belongs to.default Component<?>
getComponent
(String key) Retrieves the component stored at the given key, if it exists.default <T extends Component<T>>
TgetComponent
(String key, Class<T> clazz) Retrieves the component of the provided type stored at the given key, if it exists.A key-value map of components used for managing the children components of this component.default Collection<Component<?>>
The serializable, sorted list of children components.List<Conditional<?>>
A set of conditions used to indicate when this component should be rendered.A description used for display purposes.default Endpoint<?>
getEndpoint
(String type) Retrieves the endpoint at the given type, if it exists.default <T extends Endpoint<T>>
TgetEndpoint
(String type, Class<T> clazz) Retrieves the endpoint at the given key as the given type.A key-value map of endpoints used for managing the endpoints of this component.default Collection<Endpoint<?>>
The serializable list of endpoints.getId()
A unique identifier for the component among its siblings.getLabel()
A label used for display purposes.getOrder()
The absolute ordering of this component among its siblings.getScope()
The resource scope necessary for this component.getType()
An indicator of the type of this component.default boolean
Returns whether or not an action exists at the given key.default boolean
hasAttribute
(String key) Returns whether or not the attribute at the given key exists.default boolean
hasComponent
(String key) Returns whether or not a child is stored at the given key.default boolean
hasEndpoint
(String key) Returns whether or not an endpoint exists at the given key.default C
Sets the id of this component.default boolean
Whether or not the component is able to be augmented.boolean
Whether or not this component deals with translatable data.default C
label
(InternationalizedMessage label) Sets the label message for this component.default C
Sets the label message key for this component.default C
Sets this component as not translatable.default C
Sets the order for this component.default C
removeAction
(String key) Removes the action at the given key.default C
removeAttribute
(String key) Removes the attributes at the given key.default C
removeComponent
(String key) Removes the component at the given key.default C
removeEndpoint
(String type) Removes the endpoint with the given type.default C
Sets the scope for this component.default C
self()
Used internally to grab this component casted toComponent
.void
setActions
(Map<String, Action<?>> actions) void
setAttributes
(Map<String, Object> attributes) void
setAugmentationKey
(String augmentationKey) void
setClassifier
(String classifier) void
setComponents
(Map<String, Component<?>> components) void
setConditionals
(List<Conditional<?>> conditionals) void
setDescription
(InternationalizedMessage description) void
setEndpoints
(Map<String, Endpoint<?>> endpoints) void
void
setLabel
(InternationalizedMessage label) void
void
void
setTranslatable
(boolean translatable) void
default C
Sets this component as translatable.default C
translatable
(boolean translatable) Sets whether or not the component is translatable.default C
Sets the type of this component.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getClassifier
An indicator of the class of components this component belongs to. This is used to distinguish components that behave in similar ways within a context. For instance,Classifiers.FIELD
is used to distinguish fields from other form components, and fields have unique interactions available to them, such as interacting with the form state.- Returns:
- the classifier of the component
- See Also:
-
getType
An indicator of the type of this component. This is used to target a specific component within a class of components. For instance, a type ofFieldTypes.STRING
for aClassifiers.FIELD
will result in a text input for managing a property.- Returns:
- the type of the component
-
getId
A unique identifier for the component among its siblings. Not necessarily globally unique.- Returns:
- the ID of the component
-
getAugmentationKey
A unique identifier for the component within its full component tree. Used for targeting augmentations.- Returns:
- the augmentation key
-
isAugmentable
default boolean isAugmentable()Whether or not the component is able to be augmented. True if the augmentation key is present.- Returns:
- whether or not augmentable
-
getDescription
A description used for display purposes.- Returns:
- the description
-
getLabel
A label used for display purposes.- Returns:
- the label
-
getOrder
The absolute ordering of this component among its siblings. If null, will be sorted last.- Returns:
- the order
-
getScope
The resource scope necessary for this component. This is used by many components in order to gate access based on the resource scopes a user has access to.- Returns:
- the scope
-
isTranslatable
boolean isTranslatable()Whether or not this component deals with translatable data. The meaning of this field varies between classes of components and types of components.- Returns:
- whether or not translatable
-
getConditionals
List<Conditional<?>> getConditionals()A set of conditions used to indicate when this component should be rendered. This is most commonly used by form components to hide/show fields and grids depending on the form state.- Returns:
- the set of conditionals
-
getAttributes
A key-value map used to provide additional metadata beyond the first-class properties.- Returns:
- the attributes map
-
getComponents
A key-value map of components used for managing the children components of this component.- Returns:
- the map of children
-
getActions
A key-value map of actions used for managing the actions of this component.- Returns:
- the map of actions
-
getEndpoints
A key-value map of endpoints used for managing the endpoints of this component. The type of the endpoint is used as the key in the map.- Returns:
- the map of endpoints
-
getComponentsList
The serializable, sorted list of children components.- Returns:
- a serializable, sorted list of children components
-
getActionsList
The serializable, sorted list of actions.- Returns:
- a serializable, sorted list of actions.
-
getEndpointsList
The serializable list of endpoints.- Returns:
- a serializable list of endpoints
-
setClassifier
-
setType
-
setId
-
setAugmentationKey
-
setLabel
-
setDescription
-
setOrder
-
setScope
-
setTranslatable
void setTranslatable(boolean translatable) -
setConditionals
-
setAttributes
-
setComponents
-
setActions
-
setEndpoints
-
self
Used internally to grab this component casted toComponent
.- Returns:
- this
-
apply
Executes the provided function with this component as an argument.- Parameters:
fn
- the function- Returns:
- this
-
classifier
Sets the classifier of this component.- Parameters:
classifier
- the classifier- Returns:
- this
-
type
Sets the type of this component.- Parameters:
type
- the type- Returns:
- this
-
id
Sets the id of this component.- Parameters:
id
- the id- Returns:
- this
-
augmentationKey
Sets the augmentation key of this component.- Parameters:
augmentationKey
- the augmentation key- Returns:
- this
-
description
Sets the description message key for this component. If there is no matching message key, the provided string will be used as the description.- Parameters:
descriptionKey
- the description's message key.- Returns:
- this
-
description
Sets the description message for this component.- Parameters:
description
- the description message- Returns:
- this
-
label
Sets the label message key for this component. If there is no matching message key, the provided string will be used as the label.- Parameters:
labelKey
- the label's message key.- Returns:
- this
-
label
Sets the label message for this component.- Parameters:
label
- the label message- Returns:
- this
-
order
Sets the order for this component.- Parameters:
order
- the order- Returns:
- this
-
scope
Sets the scope for this component.- Parameters:
scope
- the scope- Returns:
- this
-
translatable
Sets whether or not the component is translatable.- Parameters:
translatable
- whether or not translatable- Returns:
- this
-
translatable
Sets this component as translatable.- Returns:
- this
-
notTranslatable
Sets this component as not translatable.- Returns:
- this
-
conditional
Adds one or more conditions to this component.- Parameters:
conditionals
- the condition(s)- Returns:
- this
-
conditionals
Adds one or more conditions to this component.- Parameters:
conditionals
- the condition(s)- Returns:
- this
-
clearConditionals
Clears the current conditions on this component.- Returns:
- this
-
attribute
Adds an attributes with the provided key and value.- Parameters:
key
- the keyvalue
- the value- Returns:
- this
-
removeAttribute
Removes the attributes at the given key.- Parameters:
key
- the key- Returns:
- this
-
hasAttribute
Returns whether or not the attribute at the given key exists.- Parameters:
key
- the key- Returns:
- whether or not the attribute exists
-
getAttribute
Retrieves the attribute at the given key.- Parameters:
key
- the key- Returns:
- the attribute value
- Throws:
IllegalArgumentException
- if no attribute exists at the key
-
getAttribute
Retrieves the attribute at the given key and casts to the provided type.- Type Parameters:
A
- the type- Parameters:
key
- the keyclazz
- the type of attribute- Returns:
- the attribute value
-
findAttribute
Finds the attribute at the given key. Null-safe version ofgetAttribute(String)
.- Parameters:
key
- the key- Returns:
- an optional with the attribute value or empty
-
findAttribute
Finds the attribute at the given key. Null-safe version ofgetAttribute(String)
.- Parameters:
key
- the key- Returns:
- an optional with the attribute value or empty
-
addComponent
Primary method of adding a child component. Inserts the component at the provided key into the component map.- Parameters:
key
- the keycomponent
- the child component- Returns:
- this
-
removeComponent
Removes the component at the given key.- Parameters:
key
- the key- Returns:
- this
-
hasComponent
Returns whether or not a child is stored at the given key.- Parameters:
key
- the key- Returns:
- whether or not a child exists at the key
-
getComponent
Retrieves the component stored at the given key, if it exists.- Parameters:
key
- the key- Returns:
- this
- Throws:
IllegalArgumentException
- if no component is found with that key
-
getComponent
Retrieves the component of the provided type stored at the given key, if it exists.- Parameters:
key
- the keyclazz
- the type of the component- Returns:
- this
- Throws:
IllegalArgumentException
- if no component is found with that key
-
get
Alias forgetComponent(String)
. -
get
Alias forgetComponent(String, Class)
. -
findComponent
Finds the component stored at the given key. Null-safe version ofgetComponent(String)
.- Parameters:
key
- the key- Returns:
- an optional of the component, or empty
-
findComponents
Retrieves a list of child components that match the given predicate.- Parameters:
predicate
- the predicate- Returns:
- the matching components
-
findComponent
Retrieves a single child component that matches the given predicate.- Parameters:
predicate
- the predicate- Returns:
- an optional with the matching component, or empty
-
hasEndpoint
Returns whether or not an endpoint exists at the given key.- Parameters:
key
- the key- Returns:
- whether or not the endpoint exists
-
getEndpoint
Retrieves the endpoint at the given type, if it exists.- Parameters:
type
- the type- Returns:
- the endpoint
- Throws:
IllegalArgumentException
- if the endpoint does not exist
-
getEndpoint
Retrieves the endpoint at the given key as the given type.- Type Parameters:
T
- the type- Parameters:
type
- the typeclazz
- the type- Returns:
- the endpoint
-
findEndpoint
Finds the endpoint stored at the given type. Null-safe version ofgetEndpoint(String)
.- Parameters:
type
- the key- Returns:
- an optional of the endpoint, or empty
-
findEndpoint
Finds the endpoint stored at the given type. Null-safe version ofgetEndpoint(String)
.- Parameters:
type
- the keyclazz
- The type ofEndpoint
to cast to.- Returns:
- an optional of the endpoint, or empty
-
findEndpoints
Retrieves a list of endpoints that match the given predicate.- Parameters:
predicate
- the predicate- Returns:
- the list of matching endpoints
-
findEndpoint
Retrieves a single endpoint matching the given predicate.- Parameters:
predicate
- the predicate- Returns:
- an optional of the matching endpoint, or empty
-
addEndpoint
Adds the provided endpoint to this component.- Parameters:
endpoint
- the endpoint to add- Returns:
- this
-
addEndpoint
Adds the provided endpoint with the given type to this component.- Parameters:
type
- the typeendpoint
- the endpoint- Returns:
- this
-
removeEndpoint
Removes the endpoint with the given type.- Parameters:
type
- the type- Returns:
- this
-
clearEndpoints
Clears the existing set of endpoints.- Returns:
- this
-
addAction
Adds an action using the action's ID as the key.- Parameters:
action
- the action- Returns:
- this
-
addAction
Adds an action at the given key.- Parameters:
key
- the keyaction
- the action- Returns:
- this
-
removeAction
Removes the action at the given key.- Parameters:
key
- the key- Returns:
- this
-
hasAction
Returns whether or not an action exists at the given key.- Parameters:
key
- the key- Returns:
- whether or not the action exists
-
getAction
Returns the action at the provided key.- Parameters:
key
- the key- Returns:
- the action
- Throws:
IllegalArgumentException
- if no action exists- See Also:
-
getAction
Returns the action at the provided key with the given type.- Type Parameters:
T
- the type- Parameters:
key
- the keyclazz
- the type- Returns:
- the action
-
findAction
Finds the action at the given key. Null-safe version ofgetAction(String)
.- Parameters:
key
- the key- Returns:
- an optional of the action, or empty
-
findActions
Retrieves a list of actions matching the given predicate.- Parameters:
predicate
- the predicate- Returns:
- the list of actions matching the predicate
-
findAction
Retrieves a single action matching the given predicate.- Parameters:
predicate
- the predicate- Returns:
- an optional of the matching action, or empty
-