Class AbstractComponent<C extends AbstractComponent<C>>
- java.lang.Object
-
- com.broadleafcommerce.metadata.dsl.core.AbstractComponent<C>
-
- All Implemented Interfaces:
Component<C>
,Copyable<C>
,Serializable
,Comparable<C>
- Direct Known Subclasses:
AbstractColumn
,AbstractFormComponent
,AbstractView
public abstract class AbstractComponent<C extends AbstractComponent<C>> extends Object implements Component<C>
The abstract implementation ofComponent
.- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractComponent(Component<?> component)
AbstractComponent(String classifier)
AbstractComponent(String classifier, String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
int
compareTo(C other)
boolean
equals(Object o)
Map<String,Action<?>>
getActions()
A key-value map of actions used for managing the actions of this component.Map<String,Object>
getAttributes()
A key-value map used to provide additional metadata beyond the first-class properties.String
getAugmentationKey()
A unique identifier for the component within its full component tree.String
getClassifier()
An indicator of the class of components this component belongs to.Map<String,Component<?>>
getComponents()
A key-value map of components used for managing the children components of this component.List<Conditional<?>>
getConditionals()
A set of conditions used to indicate when this component should be rendered.InternationalizedMessage
getDescription()
A description used for display purposes.Map<String,Endpoint<?>>
getEndpoints()
A key-value map of endpoints used for managing the endpoints of this component.String
getId()
A unique identifier for the component among its siblings.InternationalizedMessage
getLabel()
A label used for display purposes.Integer
getOrder()
The absolute ordering of this component among its siblings.String
getScope()
The resource scope necessary for this component.String
getType()
An indicator of the type of this component.int
hashCode()
boolean
isTranslatable()
Whether or not this component deals with translatable data.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
setId(String id)
void
setLabel(InternationalizedMessage label)
void
setOrder(Integer order)
void
setScope(String scope)
void
setTranslatable(boolean translatable)
void
setType(String type)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, apply, attribute, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActionsList, getAttribute, getAttribute, getComponent, getComponent, getComponentsList, getEndpoint, getEndpoint, getEndpointsList, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, translatable, translatable, type
-
-
-
-
Method Detail
-
compareTo
public int compareTo(C other)
- Specified by:
compareTo
in interfaceComparable<C extends AbstractComponent<C>>
-
getClassifier
public String getClassifier()
Description copied from interface:Component
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.- Specified by:
getClassifier
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the classifier of the component
- See Also:
for a list of classifiers
-
getType
public String getType()
Description copied from interface:Component
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.- Specified by:
getType
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the type of the component
-
getId
public String getId()
Description copied from interface:Component
A unique identifier for the component among its siblings. Not necessarily globally unique.- Specified by:
getId
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the ID of the component
-
getAugmentationKey
public String getAugmentationKey()
Description copied from interface:Component
A unique identifier for the component within its full component tree. Used for targeting augmentations.- Specified by:
getAugmentationKey
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the augmentation key
-
getLabel
public InternationalizedMessage getLabel()
Description copied from interface:Component
A label used for display purposes.- Specified by:
getLabel
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the label
-
getDescription
public InternationalizedMessage getDescription()
Description copied from interface:Component
A description used for display purposes.- Specified by:
getDescription
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the description
-
getOrder
public Integer getOrder()
Description copied from interface:Component
The absolute ordering of this component among its siblings. If null, will be sorted last.- Specified by:
getOrder
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the order
-
getScope
public String getScope()
Description copied from interface:Component
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.- Specified by:
getScope
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the scope
-
isTranslatable
public boolean isTranslatable()
Description copied from interface:Component
Whether or not this component deals with translatable data. The meaning of this field varies between classes of components and types of components.- Specified by:
isTranslatable
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- whether or not translatable
-
getConditionals
public List<Conditional<?>> getConditionals()
Description copied from interface:Component
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.- Specified by:
getConditionals
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the set of conditionals
-
getAttributes
public Map<String,Object> getAttributes()
Description copied from interface:Component
A key-value map used to provide additional metadata beyond the first-class properties.- Specified by:
getAttributes
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the attributes map
-
getComponents
public Map<String,Component<?>> getComponents()
Description copied from interface:Component
A key-value map of components used for managing the children components of this component.- Specified by:
getComponents
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the map of children
-
getActions
public Map<String,Action<?>> getActions()
Description copied from interface:Component
A key-value map of actions used for managing the actions of this component.- Specified by:
getActions
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the map of actions
-
getEndpoints
public Map<String,Endpoint<?>> getEndpoints()
Description copied from interface:Component
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.- Specified by:
getEndpoints
in interfaceComponent<C extends AbstractComponent<C>>
- Returns:
- the map of endpoints
-
setClassifier
public void setClassifier(String classifier)
- Specified by:
setClassifier
in interfaceComponent<C extends AbstractComponent<C>>
-
setType
public void setType(String type)
- Specified by:
setType
in interfaceComponent<C extends AbstractComponent<C>>
-
setId
public void setId(String id)
- Specified by:
setId
in interfaceComponent<C extends AbstractComponent<C>>
-
setAugmentationKey
public void setAugmentationKey(String augmentationKey)
- Specified by:
setAugmentationKey
in interfaceComponent<C extends AbstractComponent<C>>
-
setLabel
public void setLabel(InternationalizedMessage label)
- Specified by:
setLabel
in interfaceComponent<C extends AbstractComponent<C>>
-
setDescription
public void setDescription(InternationalizedMessage description)
- Specified by:
setDescription
in interfaceComponent<C extends AbstractComponent<C>>
-
setOrder
public void setOrder(Integer order)
- Specified by:
setOrder
in interfaceComponent<C extends AbstractComponent<C>>
-
setScope
public void setScope(String scope)
- Specified by:
setScope
in interfaceComponent<C extends AbstractComponent<C>>
-
setTranslatable
public void setTranslatable(boolean translatable)
- Specified by:
setTranslatable
in interfaceComponent<C extends AbstractComponent<C>>
-
setConditionals
public void setConditionals(List<Conditional<?>> conditionals)
- Specified by:
setConditionals
in interfaceComponent<C extends AbstractComponent<C>>
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
- Specified by:
setAttributes
in interfaceComponent<C extends AbstractComponent<C>>
-
setComponents
public void setComponents(Map<String,Component<?>> components)
- Specified by:
setComponents
in interfaceComponent<C extends AbstractComponent<C>>
-
setActions
public void setActions(Map<String,Action<?>> actions)
- Specified by:
setActions
in interfaceComponent<C extends AbstractComponent<C>>
-
setEndpoints
public void setEndpoints(Map<String,Endpoint<?>> endpoints)
- Specified by:
setEndpoints
in interfaceComponent<C extends AbstractComponent<C>>
-
canEqual
protected boolean canEqual(Object other)
-
-