Interface RepositoryModelItemType
- All Superinterfaces:
ModelItemType
,PluginAware
- All Known Subinterfaces:
ComplexRepositoryElementType<T>
,RepositoryElementType<T>
,RepositoryModelItemGroupType
- All Known Implementing Classes:
BinaryRepositoryElementType
,BooleanRepositoryElementType
,CompositeRepositoryModelItemType
,ContentContentElementType
,ContentRepositoryElementType
,DateRepositoryElementType
,DateTimeRepositoryElementType
,DoubleRepositoryElementType
,FileContentElementType
,FileRepositoryElementType
,GeocodeRepositoryElementType
,HTMLRichTextContentElementType
,HTMLRichTextRepositoryElementType
,LongRepositoryElementType
,MultilingualStringRepositoryElementType
,PasswordRepositoryElementType
,ReferenceContentElementType
,ReferenceRepositoryElementType
,RepeaterRepositoryModelItemType
,RichTextContentElementType
,RichTextRepositoryElementType
,StringRepositoryElementType
,UserRepositoryElementType
Interface for types of model items stored in the repository
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Suffix of the metadata used to check if a data is present but empty -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the type of repository data used for this typeboolean
hasNonEmptyValue
(RepositoryData parentData, String name) Check if there is a non empty value in the given repository datadefault boolean
hasValue
(RepositoryData parentData, String name) Check if there is a value, even empty, in the given repository datadefault boolean
isCompatible
(RepositoryData parentData, String name) Checks if the value in the given repository data is compatible with the item typedefault boolean
isMultiple
(RepositoryData parentData, String name) Checks if the value in the given repository data is multipledefault void
remove
(ModifiableRepositoryData parentData, String name) Remove the value into the given repository dataMethods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToSAX, valueToSAX, valueToSAXForEdition
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
-
Field Details
-
EMPTY_METADATA_SUFFIX
Suffix of the metadata used to check if a data is present but empty- See Also:
-
-
Method Details
-
isCompatible
Checks if the value in the given repository data is compatible with the item type- Parameters:
parentData
- repository data containing the data to checkname
- the name of the data to check- Returns:
true
if the data type matches the current type,false
otherwise- Throws:
UnknownDataException
- if there is no data in the parent repository data with this name
-
getRepositoryDataType
Retrieves the type of repository data used for this type- Returns:
- the type of repository data used for this type
-
isMultiple
Checks if the value in the given repository data is multiple- Parameters:
parentData
- repository data containing the data to checkname
- the name of the data to check- Returns:
true
if the stored data is multiple,false
otherwise- Throws:
UnknownDataException
- if there is no data in the parent repository data with this name
-
hasValue
Check if there is a value, even empty, in the given repository data- Parameters:
parentData
- repository data containing the valuename
- the name of the element to check- Returns:
true
if there is value,false
otherwise- Throws:
BadItemTypeException
- if the reading value doesn't match this element type
-
hasNonEmptyValue
Check if there is a non empty value in the given repository data- Parameters:
parentData
- repository data containing the valuename
- the name of the element to check- Returns:
true
if there is a non empty value,false
otherwise- Throws:
BadItemTypeException
- if the reading value doesn't match this element type
-
remove
Remove the value into the given repository data- Parameters:
parentData
- repository where the value to remove is stored.name
- the name of the element to remove
-