Package org.ametys.cms.model.properties
Class AbstractStaticProperty<T,X extends ModelAwareDataAwareAmetysObject>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.model.properties.AbstractProperty<T,X>
org.ametys.cms.model.properties.AbstractStaticProperty<T,X>
- Type Parameters:
T- type of the property valuesX- type of ametys object supported by this property
- All Implemented Interfaces:
Comparable<ModelItem>,Property<T,,X> ElementDefinition<T>,ModelItem,PluginAware,Labelable,ModifiableLabelable,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
AbstractIndexableStaticProperty,AbstractSystemProperty
public abstract class AbstractStaticProperty<T,X extends ModelAwareDataAwareAmetysObject>
extends AbstractProperty<T,X>
implements Configurable, Serviceable, Contextualizable
Abstract class for single property
-
Field Summary
FieldsFields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_loggerFields inherited from class org.ametys.runtime.model.AbstractModelItem
__context, __serviceManagerFields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPEFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringRetrieves the name of the configuration attribute that contains the name of the propertyprotected void_parseAndSetEnumerator(Configuration configuration, String pluginName) Parse the configuration to set the enumerator.protected I18nizableText_parseDescription(Configuration configuration) Parses the description of the propertyprotected I18nizableText_parseLabel(Configuration configuration) Parses the label of the propertyprotected String_parseName(Configuration configuration) Parses the name of the propertyvoidconfigure(Configuration configuration) voidcontextualize(Context context) voidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
getType, getTypeId, init, isEditable, setPluginInfoMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _toJSON, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAXMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getModel, getName, getParent, getPath, getPluginName, hashCode, setContext, setDescription, setDisableConditions, setLabel, setModel, setName, setParent, setPluginName, setServiceManager, toJSON, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getNameMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAXMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setNameMethods inherited from interface org.ametys.cms.model.properties.Property
getValue, valueToJSON, valueToSAX
-
Field Details
-
_context
The avalon context
-
-
Constructor Details
-
AbstractStaticProperty
public AbstractStaticProperty()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
_parseName
Parses the name of the property- Parameters:
configuration- the property configuration to use.- Returns:
- the name of the property.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_getNameConfigurationAttribute
Retrieves the name of the configuration attribute that contains the name of the property- Returns:
- the name of the configuration attribute that contains the name of the property
-
_parseLabel
Parses the label of the property- Parameters:
configuration- the property configuration to use.- Returns:
- the label of the property.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseDescription
protected I18nizableText _parseDescription(Configuration configuration) throws ConfigurationException Parses the description of the property- Parameters:
configuration- the property configuration to use.- Returns:
- the description of the property.
- Throws:
ConfigurationException- if the configuration is not valid.
-
_parseAndSetEnumerator
protected void _parseAndSetEnumerator(Configuration configuration, String pluginName) throws ConfigurationException Parse the configuration to set the enumerator.- Parameters:
configuration- The configuration of the propertypluginName- The plugin name- Throws:
ConfigurationException- if an error occurs
-