Interface RepositoryElementType<T>
- Type Parameters:
T
- Type of the element value
- All Superinterfaces:
ElementType<T>
,ModelItemType
,PluginAware
,RepositoryModelItemType
- All Known Subinterfaces:
ComplexRepositoryElementType<T>
- All Known Implementing Classes:
BinaryRepositoryElementType
,BooleanRepositoryElementType
,ContentContentElementType
,ContentRepositoryElementType
,DateRepositoryElementType
,DateTimeRepositoryElementType
,DoubleRepositoryElementType
,FileContentElementType
,FileRepositoryElementType
,GeocodeRepositoryElementType
,HTMLRichTextContentElementType
,HTMLRichTextRepositoryElementType
,LongRepositoryElementType
,MatrixRepositoryElementType
,MultilingualStringRepositoryElementType
,PasswordRepositoryElementType
,ReferenceContentElementType
,ReferenceRepositoryElementType
,ResourceReferenceRepositoryElementType
,RichTextContentElementType
,RichTextRepositoryElementType
,RuleRepositoryElementType
,StringRepositoryElementType
,UserRepositoryElementType
Interface for types of elements stored in the repository
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
EMPTY_METADATA_SUFFIX
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
externalizableValueToJSON
(Object value, DataContext context) Converts the given externalizable value into JSON objectread
(RepositoryData parentData, String name) Read the value in the given repository datavoid
write
(ModifiableRepositoryData parentData, String name, Object value) Write the value into the given repository dataMethods inherited from interface org.ametys.runtime.model.type.ElementType
castValue, compareValues, fromJSONForClient, getManagedClass, getManagedClassArray, isCompatible, isSimple, parseConfiguration, toString, valueFromXML
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToJSONForClient, valueToJSONForClient, valueToJSONForEdition, valueToSAX, valueToSAX, valueToSAXForEdition
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
getRepositoryDataType, hasNonEmptyValue, hasValue, isCompatible, isMultiple, remove
-
Method Details
-
read
Read the value in the given repository data- Parameters:
parentData
- repository data containing the valuename
- the name of the element to read- Returns:
- the value. Can return a T or a T[]. That's why the return type is Object
- Throws:
BadItemTypeException
- if the reading value doesn't match this element type
-
write
void write(ModifiableRepositoryData parentData, String name, Object value) throws BadItemTypeException Write the value into the given repository data- Parameters:
parentData
- repository where to store the value.name
- the name of the element to writevalue
- the value to write. Can be a T or a T[]. That's why it is an Object- Throws:
BadItemTypeException
- If the given value doesn't match this element type
-
externalizableValueToJSON
Converts the given externalizable value into JSON object- Parameters:
value
- the value to convertcontext
- The context of the data to convert- Returns:
- the converted externalizable value
-