Package org.ametys.cms.contenttype
Class AttributeDefinition<T>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.ElementDefinition<T>
org.ametys.cms.contenttype.AttributeDefinition<T>
- Type Parameters:
T
- Type of the attribute value
- All Implemented Interfaces:
Comparable<ModelItem>
,RestrictedModelItem<Content>
,ModelItem
,Labelable
,ModifiableLabelable
- Direct Known Subclasses:
ContentAttributeDefinition
,RichTextAttributeDefinition
public class AttributeDefinition<T>
extends ElementDefinition<T>
implements RestrictedModelItem<Content>
The definition of a content type attribute
-
Field Summary
Fields inherited from class org.ametys.runtime.model.ElementDefinition
_logger, CONFIG_DEFAULT_VALUE_TYPE
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManager
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ExternalizableDataProviderExtensionPoint
Retrieves theExternalizableDataProviderExtensionPoint
protected ContentRestrictedModelItemHelper
Retrieves the helper forModelItem
s with restrictions on contentsprotected boolean
_shouldJSONBeEmpty
(DefinitionContext context) Checks if the current definition JSON conversion should return an empty map_toJSON
(DefinitionContext context) Converts the model item in a JSON mapboolean
Determines if the object can be read by the definitionboolean
Determines if the object can be written by the definitionvoid
setRestrictions
(Restrictions restrictions) Set the restrictions for the attributeMethods inherited from class org.ametys.runtime.model.ElementDefinition
_getDefaultValue, _getParsedDefaultValues, getCustomEnumerator, getCustomValidator, getDefaultValue, getDisableConditions, getEnumerator, getEnumeratorConfiguration, getPluginName, getType, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setDisableConditions, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setPluginName, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters
Methods inherited from class org.ametys.runtime.model.AbstractModelItem
addItemChecker, compareTo, equals, getDescription, getItemCheckers, getLabel, getModel, getName, getParent, getPath, hashCode, setDescription, setLabel, setModel, setName, setParent, setServiceManager, toJSON, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
Methods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getItemCheckers, getModel, getParent, getPath, getType, setModel, setParent, setType, toJSON
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Constructor Details
-
AttributeDefinition
public AttributeDefinition()
-
-
Method Details
-
setRestrictions
Set the restrictions for the attribute- Parameters:
restrictions
- the restrictions to set
-
canRead
Description copied from interface:RestrictedModelItem
Determines if the object can be read by the definition- Specified by:
canRead
in interfaceRestrictedModelItem<T>
- Parameters:
content
- the object- Returns:
- true if the object can be read by the definition, false otherwise
-
canWrite
Description copied from interface:RestrictedModelItem
Determines if the object can be written by the definition- Specified by:
canWrite
in interfaceRestrictedModelItem<T>
- Parameters:
content
- the object- Returns:
- true if the object can be written by the definition, false otherwise
-
_getRestrictedModelItemHelper
Retrieves the helper forModelItem
s with restrictions on contents- Returns:
- the
ContentRestrictedModelItemHelper
-
_toJSON
Description copied from class:AbstractModelItem
Converts the model item in a JSON map- Overrides:
_toJSON
in classElementDefinition<T>
- Parameters:
context
- the context of the definition- Returns:
- The model item as a JSON map
- Throws:
ProcessingException
- If an error occurs when converting the model item
-
_shouldJSONBeEmpty
Description copied from class:AbstractModelItem
Checks if the current definition JSON conversion should return an empty map- Overrides:
_shouldJSONBeEmpty
in classAbstractModelItem
- Parameters:
context
- the context of the definition- Returns:
true
if the JSON conversion should return an empty map,false
otherwise
-
_getExternalizableDataProviderExtensionPoint
Retrieves theExternalizableDataProviderExtensionPoint
- Returns:
- the
ExternalizableDataProviderExtensionPoint
-