Package org.ametys.runtime.model
Interface ElementDefinition<T>
- Type Parameters:
T
- Type of the element value
- All Superinterfaces:
Comparable<ModelItem>
,Labelable
,ModelItem
,ModifiableLabelable
- All Known Subinterfaces:
ContentElementDefinition
,Property<T,
,X> SystemProperty<T,
X>
- All Known Implementing Classes:
AbstractContentProperty
,AbstractDateTimeSystemProperty
,AbstractMultiTypedValuesProperty
,AbstractMultiValuesProperty
,AbstractProperty
,AbstractSystemProperty
,AbstractUserSystemProperty
,AttributeDefinition
,CollectionsSystemProperty
,CommentsSystemProperty
,ContentAttributeDefinition
,ContentPrivacySystemProperty
,ContentTypeSystemProperty
,ContributorSystemProperty
,CreationDateSystemProperty
,CreatorSystemProperty
,DefaultContentElementDefinition
,DefaultElementDefinition
,DegreeOrderProperty
,DegreeTypeProperty
,ElementRefProperty
,FirstValidationSystemProperty
,FirstValidatorSystemProperty
,FulltextSystemProperty
,HasLiveVersionSystemProperty
,LanguageSystemProperty
,LastMajorValidationSystemProperty
,LastMajorValidatorSystemProperty
,LastModifiedSystemProperty
,LastSynchronizationSystemProperty
,LastSynchronizationUserSystemProperty
,LastValidationSystemProperty
,LastValidatorSystemProperty
,MemberProjectProperty
,MultiContentValuesProperty
,MultiStringValuesProperty
,OrgUnitAncestorProperty
,OrphanSystemProperty
,PagesSystemProperty
,ParentContentSystemProperty
,ParentProgramsProperty
,ParentSubProgramsProperty
,PinProperty
,ProfiledGroupsTagsSystemProperty
,ProgramSkillsProperty
,RichTextAttributeDefinition
,SemanticAnnotationSystemProperty
,ServiceParameter
,SharedSystemProperty
,SiteSystemProperty
,SiteTypeSystemProperty
,SubProgramParentProgramProperty
,TagsSystemProperty
,TagsSystemProperty
,ViewBasedFullTextSystemProperty
,ViewParameter
,WorkflowStepSystemProperty
,WorkflowStepSystemProperty
Interface of the definition of a single model item (parameter, attribute)
-
Field Summary
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the parsed default valuesdefault Enumerator
getCriterionEnumerator
(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) Get the enumerator to use when rendering this element as a criterionRetrieves the custom enumerator's class nameRetrieves the custom validator's class name<X> X
Retrieves the default value, as an object corresponding to the definition's type and cardinality Retrievesnull
if no default value is defined for this definitionRetrieves the enumerator.Retrieves the custom enumerator's configurationgetType()
Retrieves the type.Retrieves the validator.Retrieves the custom validator's configuraitondefault boolean
Determines if the definition is editable, i.e.boolean
Test if the element is multiple.void
setCustomEnumerator
(String customEnumerator) Set the custom enumerator's class namevoid
setCustomValidator
(String customValidator) Set the custom validator's class namevoid
setDefaultValue
(T defaultValue) Set a default value to the definition The default value is single, classic default valuevoid
setEnumerator
(Enumerator<T> enumerator) Set the enumerator.void
setEnumeratorConfiguration
(Configuration enumeratorConfiguration) Set the custom enumerator's configurationvoid
setMultiple
(boolean isMultiple) Set the element multiple status.void
setParsedDefaultValues
(List<Pair<String, Object>> parsedDefaultValues) Set the parsed default values.void
setValidator
(Validator validator) Set the validator.void
setValidatorConfiguration
(Configuration validatorConfiguration) Set the custom validator's configurationMethods 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, getCriterionWidget, getCriterionWidgetParameters, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAX
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Field Details
-
CONFIG_DEFAULT_VALUE_TYPE
config type for default values- See Also:
-
-
Method Details
-
getType
ElementType<T> getType()Description copied from interface:ModelItem
Retrieves the type. -
getEnumerator
Retrieves the enumerator.- Returns:
- the enumerator or
null
if none is defined.
-
setEnumerator
Set the enumerator.- Parameters:
enumerator
- the enumerator.
-
getCustomEnumerator
Retrieves the custom enumerator's class name- Returns:
- the custom enumerator's class name
-
setCustomEnumerator
Set the custom enumerator's class name- Parameters:
customEnumerator
- the custom enumerator's class name
-
getEnumeratorConfiguration
Retrieves the custom enumerator's configuration- Returns:
- the custom enumerator's configuration
-
setEnumeratorConfiguration
Set the custom enumerator's configuration- Parameters:
enumeratorConfiguration
- the custom enumerator's configuration
-
getCriterionEnumerator
default Enumerator getCriterionEnumerator(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) throws ConfigurationException Get the enumerator to use when rendering this element as a criterion- Parameters:
configuration
- The enumerator configuration.enumeratorManager
- ComponentManager for the criterion'sEnumerator
- Returns:
- The enumerator or null if the element'critérion is not enumerated.
- Throws:
ConfigurationException
- If an error occurs while initializing the enumerator
-
getValidator
Retrieves the validator.- Returns:
- the validator or
null
if none is defined.
-
setValidator
Set the validator.- Parameters:
validator
- the validator.
-
getCustomValidator
Retrieves the custom validator's class name- Returns:
- the custom validator's class name
-
setCustomValidator
Set the custom validator's class name- Parameters:
customValidator
- the custom validator's class name
-
getValidatorConfiguration
Retrieves the custom validator's configuraiton- Returns:
- the custom validator's configuration
-
setValidatorConfiguration
Set the custom validator's configuration- Parameters:
validatorConfiguration
- the custom validator's configuration
-
getDefaultValue
Retrieves the default value, as an object corresponding to the definition's type and cardinality Retrievesnull
if no default value is defined for this definition- Type Parameters:
X
- The type of the default value- Returns:
- the default value.
-
setParsedDefaultValues
Set the parsed default values. If the definition is not multiple, the list should contain only one element A parsed default value is described by its type and an object depending on the type- Parameters:
parsedDefaultValues
- the parsed default values.
-
setDefaultValue
Set a default value to the definition The default value is single, classic default value- Parameters:
defaultValue
- the default value to set
-
_getParsedDefaultValues
Retrieves the parsed default values- Returns:
- the parsed default values
-
isMultiple
boolean isMultiple()Test if the element is multiple.- Returns:
true
if the metadata is multiple.
-
setMultiple
Set the element multiple status.- Parameters:
isMultiple
- the element multiple status.
-
isEditable
Determines if the definition is editable, i.e. if it can be part of a view used for edition- Returns:
true
if the definition is editable,false
otherwise
-