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 booleancanEqual(Object other)intcompareTo(C other)booleanequals(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.StringgetAugmentationKey()A unique identifier for the component within its full component tree.StringgetClassifier()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.InternationalizedMessagegetDescription()A description used for display purposes.Map<String,Endpoint<?>>getEndpoints()A key-value map of endpoints used for managing the endpoints of this component.StringgetId()A unique identifier for the component among its siblings.InternationalizedMessagegetLabel()A label used for display purposes.IntegergetOrder()The absolute ordering of this component among its siblings.StringgetScope()The resource scope necessary for this component.StringgetType()An indicator of the type of this component.inthashCode()booleanisTranslatable()Whether or not this component deals with translatable data.voidsetActions(Map<String,Action<?>> actions)voidsetAttributes(Map<String,Object> attributes)voidsetAugmentationKey(String augmentationKey)voidsetClassifier(String classifier)voidsetComponents(Map<String,Component<?>> components)voidsetConditionals(List<Conditional<?>> conditionals)voidsetDescription(InternationalizedMessage description)voidsetEndpoints(Map<String,Endpoint<?>> endpoints)voidsetId(String id)voidsetLabel(InternationalizedMessage label)voidsetOrder(Integer order)voidsetScope(String scope)voidsetTranslatable(boolean translatable)voidsetType(String type)StringtoString()-
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:
compareToin interfaceComparable<C extends AbstractComponent<C>>
-
getClassifier
public String getClassifier()
Description copied from interface:ComponentAn 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.FIELDis 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:
getClassifierin 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:ComponentAn 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.STRINGfor aClassifiers.FIELDwill result in a text input for managing a property.- Specified by:
getTypein interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the type of the component
-
getId
public String getId()
Description copied from interface:ComponentA unique identifier for the component among its siblings. Not necessarily globally unique.- Specified by:
getIdin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the ID of the component
-
getAugmentationKey
public String getAugmentationKey()
Description copied from interface:ComponentA unique identifier for the component within its full component tree. Used for targeting augmentations.- Specified by:
getAugmentationKeyin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the augmentation key
-
getLabel
public InternationalizedMessage getLabel()
Description copied from interface:ComponentA label used for display purposes.- Specified by:
getLabelin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the label
-
getDescription
public InternationalizedMessage getDescription()
Description copied from interface:ComponentA description used for display purposes.- Specified by:
getDescriptionin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the description
-
getOrder
public Integer getOrder()
Description copied from interface:ComponentThe absolute ordering of this component among its siblings. If null, will be sorted last.- Specified by:
getOrderin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the order
-
getScope
public String getScope()
Description copied from interface:ComponentThe 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:
getScopein interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the scope
-
isTranslatable
public boolean isTranslatable()
Description copied from interface:ComponentWhether or not this component deals with translatable data. The meaning of this field varies between classes of components and types of components.- Specified by:
isTranslatablein interfaceComponent<C extends AbstractComponent<C>>- Returns:
- whether or not translatable
-
getConditionals
public List<Conditional<?>> getConditionals()
Description copied from interface:ComponentA 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:
getConditionalsin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the set of conditionals
-
getAttributes
public Map<String,Object> getAttributes()
Description copied from interface:ComponentA key-value map used to provide additional metadata beyond the first-class properties.- Specified by:
getAttributesin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the attributes map
-
getComponents
public Map<String,Component<?>> getComponents()
Description copied from interface:ComponentA key-value map of components used for managing the children components of this component.- Specified by:
getComponentsin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the map of children
-
getActions
public Map<String,Action<?>> getActions()
Description copied from interface:ComponentA key-value map of actions used for managing the actions of this component.- Specified by:
getActionsin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the map of actions
-
getEndpoints
public Map<String,Endpoint<?>> getEndpoints()
Description copied from interface:ComponentA 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:
getEndpointsin interfaceComponent<C extends AbstractComponent<C>>- Returns:
- the map of endpoints
-
setClassifier
public void setClassifier(String classifier)
- Specified by:
setClassifierin interfaceComponent<C extends AbstractComponent<C>>
-
setType
public void setType(String type)
- Specified by:
setTypein interfaceComponent<C extends AbstractComponent<C>>
-
setId
public void setId(String id)
- Specified by:
setIdin interfaceComponent<C extends AbstractComponent<C>>
-
setAugmentationKey
public void setAugmentationKey(String augmentationKey)
- Specified by:
setAugmentationKeyin interfaceComponent<C extends AbstractComponent<C>>
-
setLabel
public void setLabel(InternationalizedMessage label)
- Specified by:
setLabelin interfaceComponent<C extends AbstractComponent<C>>
-
setDescription
public void setDescription(InternationalizedMessage description)
- Specified by:
setDescriptionin interfaceComponent<C extends AbstractComponent<C>>
-
setOrder
public void setOrder(Integer order)
- Specified by:
setOrderin interfaceComponent<C extends AbstractComponent<C>>
-
setScope
public void setScope(String scope)
- Specified by:
setScopein interfaceComponent<C extends AbstractComponent<C>>
-
setTranslatable
public void setTranslatable(boolean translatable)
- Specified by:
setTranslatablein interfaceComponent<C extends AbstractComponent<C>>
-
setConditionals
public void setConditionals(List<Conditional<?>> conditionals)
- Specified by:
setConditionalsin interfaceComponent<C extends AbstractComponent<C>>
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
- Specified by:
setAttributesin interfaceComponent<C extends AbstractComponent<C>>
-
setComponents
public void setComponents(Map<String,Component<?>> components)
- Specified by:
setComponentsin interfaceComponent<C extends AbstractComponent<C>>
-
setActions
public void setActions(Map<String,Action<?>> actions)
- Specified by:
setActionsin interfaceComponent<C extends AbstractComponent<C>>
-
setEndpoints
public void setEndpoints(Map<String,Endpoint<?>> endpoints)
- Specified by:
setEndpointsin interfaceComponent<C extends AbstractComponent<C>>
-
canEqual
protected boolean canEqual(Object other)
-
-