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
public interface RepositoryModelItemType extends ModelItemType
Interface for types of model items stored in the repository
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMPTY_METADATA_SUFFIX
Suffix of the metadata used to check if a data is present but empty
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getRepositoryDataType()
Retrieves 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 data-
Methods 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 Detail
-
EMPTY_METADATA_SUFFIX
static final String EMPTY_METADATA_SUFFIX
Suffix of the metadata used to check if a data is present but empty- See Also:
- Constant Field Values
-
-
Method Detail
-
isCompatible
default boolean isCompatible(RepositoryData parentData, String name) throws UnknownDataException
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
String getRepositoryDataType()
Retrieves the type of repository data used for this type- Returns:
- the type of repository data used for this type
-
isMultiple
default boolean isMultiple(RepositoryData parentData, String name) throws UnknownDataException
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
default boolean hasValue(RepositoryData parentData, String name) throws BadItemTypeException
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
boolean hasNonEmptyValue(RepositoryData parentData, String name) throws BadItemTypeException
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
default void remove(ModifiableRepositoryData parentData, String name) throws UnknownDataException
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- Throws:
UnknownDataException
- if the value with the given name does not exist
-
-