Interface ModifiableComposite
- All Superinterfaces:
Composite,DataHolder,ModifiableDataHolder
- All Known Subinterfaces:
ModifiableIndexableComposite,ModifiableIndexableRepeaterEntry,ModifiableModelAwareComposite,ModifiableRepeaterEntry
- All Known Implementing Classes:
DefaultModifiableComposite,DefaultModifiableIndexableComposite,DefaultModifiableIndexableRepeaterEntry,DefaultModifiableModelAwareComposite,DefaultModifiableRepeaterEntry
Interface for modifiable composites
-
Method Summary
Modifier and TypeMethodDescriptiondefault ModifiableCompositegetComposite(String compositePath) Retrieves the composite at the given pathdefault ModifiableCompositegetComposite(String compositePath, boolean createNew) Retrieves the composite at the given pathRetrieves the default implementation of aDataHolderto usedefault Optional<? extends ModifiableDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootdefault ModifiableDataHolderRetrieves theDataHolderthat is the root of the current onedefault voidremoveValue(String dataPath) Removes the stored value of the data at the given pathdefault voidSets the value of the data at the given pathdefault voidSets the value of the data at the given pathdefault <T extends SynchronizationResult>
TsynchronizeValues(Map<String, Object> values) Synchronizes the given values with the current onesMethods inherited from interface org.ametys.plugins.repository.data.holder.group.Composite
dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames, getModelItemTypeExtensionPoint, getType, getValue, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, hasDifferences, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAXMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData
-
Method Details
-
getComposite
default ModifiableComposite getComposite(String compositePath) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceComposite- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrieve- Returns:
- the composite or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUnknownTypeException- if the type composite is not available for this data holderBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the data holder has a model and the given composite path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
default ModifiableComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Parameters:
compositePath- path of the composite to retrievecreateNew-trueto create the composite if it does not exist,falseotherwise- Returns:
- the composite or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given composite path is null or emptyUnknownTypeException- if the type composite is not available for this data holderBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the data holder has a model and the given composite path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
synchronizeValues
default <T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values) throws UnknownTypeException, NotUniqueTypeException, BadItemTypeException, UndefinedItemPathExceptionDescription copied from interface:ModifiableDataHolderSynchronizes the given values with the current ones- Specified by:
synchronizeValuesin interfaceModifiableDataHolder- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
values- the values to synchronize- Returns:
- the
SynchronizationResult - Throws:
UnknownTypeException- if there is no available type compatible with a given value for this data holder's type extension pointNotUniqueTypeException- if there is more than one available types compatibles with the a value for this data holder's type extension pointBadItemTypeException- if type of the a data doesn't match the corresponding given value to setUndefinedItemPathException- if the data holder has a model and a key in the given Map refers to a data that is not defined by the model
-
setValue
default void setValue(String dataPath, Object value) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderSets the value of the data at the given path- Specified by:
setValuein interfaceModifiableDataHolder- Parameters:
dataPath- path of the datavalue- the value to set. To empty a value, useModifiableDataHolder.setValue(String, Object, String)with anullvalue- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- if the given the data path is composed of an non existing groupUnknownTypeException- if there is no available type compatible with the given value for this data holder's type extension pointNotUniqueTypeException- if there is more than one available types compatibles with the given value for this data holder's type extension pointBadItemTypeException- if type of the data at the given path doesn't match the given value to setUndefinedItemPathException- if the data holder has a model and the given data path is not defined by the modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
setValue
default void setValue(String dataPath, Object value, String dataTypeId) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderSets the value of the data at the given path- Specified by:
setValuein interfaceModifiableDataHolder- Parameters:
dataPath- path of the datavalue- the value to set. Givenullto empty the value.dataTypeId- type identifier of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- if the given data path is composed of an non existing groupUnknownTypeException- if the given type is not available for this data holder's type extension pointBadItemTypeException- if the given type doesn't match the given value to setUndefinedItemPathException- if the data holder has a model and the given data path is not defined by the modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeValue
default void removeValue(String dataPath) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderRemoves the stored value of the data at the given path- Specified by:
removeValuein interfaceModifiableDataHolder- Parameters:
dataPath- path of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownTypeException- if the the data to remove is in a group and there is no available type compatible with this groupBadItemTypeException- if the value of the parent of the given path is not an item containerUndefinedItemPathException- if the data holder has a model and the given data path is not defined by the modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getParentDataHolder
Description copied from interface:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceComposite- Specified by:
getParentDataHolderin interfaceDataHolder- Specified by:
getParentDataHolderin interfaceModifiableDataHolder- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceComposite- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Returns:
- the root
DataHolder
-
getDefaultDataHolder
Description copied from interface:CompositeRetrieves the default implementation of aDataHolderto use- Specified by:
getDefaultDataHolderin interfaceComposite- Returns:
- the
DataHolder
-