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,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
FieldsFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the parsed default valuesdefault EnumeratorgetCriterionEnumerator(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> XRetrieves the default value, as an object corresponding to the definition's type and cardinality Retrievesnullif 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 booleanDetermines if the definition is editable, i.e.booleanTest if the element is multiple.voidsetCustomEnumerator(String customEnumerator) Set the custom enumerator's class namevoidsetCustomValidator(String customValidator) Set the custom validator's class namevoidsetDefaultValue(T defaultValue) Set a default value to the definition The default value is single, classic default valuevoidsetEnumerator(Enumerator<T> enumerator) Set the enumerator.voidsetEnumeratorConfiguration(Configuration enumeratorConfiguration) Set the custom enumerator's configurationvoidsetMultiple(boolean isMultiple) Set the element multiple status.voidsetParsedDefaultValues(List<Pair<String, Object>> parsedDefaultValues) Set the parsed default values.voidsetValidator(Validator validator) Set the validator.voidsetValidatorConfiguration(Configuration validatorConfiguration) Set the custom validator's configurationMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getNameMethods 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, toSAXMethods 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:ModelItemRetrieves the type. -
getEnumerator
Retrieves the enumerator.- Returns:
- the enumerator or
nullif 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
nullif 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 Retrievesnullif 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:
trueif 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:
trueif the definition is editable,falseotherwise
-