T
- Type of the element valuepublic interface ComplexRepositoryElementType<T> extends RepositoryElementType<T>
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_ID_DATA_NAME
Data name for storing the type identifier of an element with multiple values
|
Modifier and Type | Method and Description |
---|---|
String |
getNodeType()
Retrieves the type of node used for this type
|
default boolean |
isCompatible(RepositoryData parentData,
String name)
Checks if the value in the given repository data is compatible with the item type
|
default Object |
read(RepositoryData parentData,
String name)
Read the value in the given repository data
|
T |
readSingleValue(RepositoryData singleValueData)
Read the single value in the given repository data
|
default boolean |
removeValueBeforeWritingIt()
Determines if the existing value has to be removed before writing the new one
|
default void |
write(ModifiableRepositoryData parentData,
String name,
Object value)
Write the value into the given repository data
|
void |
writeSingleValue(ModifiableRepositoryData parentData,
String name,
T value)
Write the single value into the given repository data
This method is called by the
write(ModifiableRepositoryData, String, Object) method, once for each value if the value is an array |
castValue, fromJSONForClient, getManagedClass, getManagedClassArray, isCompatible, isSimple, parseConfiguration, toString, valueToJSONForClient
getId, valueToSAX
setPluginInfo
static final String TYPE_ID_DATA_NAME
default Object read(RepositoryData parentData, String name) throws BadItemTypeException
RepositoryElementType
read
in interface RepositoryElementType<T>
parentData
- repository data containing the valuename
- the name of the element to readBadItemTypeException
- if the reading value doesn't match this element typeT readSingleValue(RepositoryData singleValueData)
singleValueData
- repository data containing the valuedefault void write(ModifiableRepositoryData parentData, String name, Object value) throws BadItemTypeException
RepositoryElementType
write
in interface RepositoryElementType<T>
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 ObjectBadItemTypeException
- If the given value doesn't match this element typedefault boolean removeValueBeforeWritingIt()
true
if the previous value has to be removed, false
otherwisevoid writeSingleValue(ModifiableRepositoryData parentData, String name, T value)
write(ModifiableRepositoryData, String, Object)
method, once for each value if the value is an arrayparentData
- repository where to store the single value.name
- the name of the element to writevalue
- the single value to write. Can be null. In this case, an empty data must be createddefault boolean isCompatible(RepositoryData parentData, String name) throws UnknownDataException
RepositoryModelItemType
isCompatible
in interface RepositoryModelItemType
parentData
- repository data containing the data to checkname
- the name of the data to checktrue
if the data type matches the current type, false
otherwiseUnknownDataException
- if there is no data in the parent repository data with this nameString getNodeType()