Class ModifiableModelLessComposite
java.lang.Object
org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
org.ametys.plugins.repository.data.holder.group.impl.ModelLessComposite
org.ametys.plugins.repository.data.holder.group.impl.ModifiableModelLessComposite
- All Implemented Interfaces:
DataHolder
,Composite
,ModifiableComposite
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
public class ModifiableModelLessComposite
extends ModelLessComposite
implements ModifiableComposite, ModifiableModelLessDataHolder
Class for modifiable model free composites
-
Field Summary
Modifier and TypeFieldDescriptionprotected ModifiableModelLessDataHolder
the default implementation of aModifiableModelLessDataHolder
to useprotected ModifiableRepositoryData
The modifiable repository data of this compositeFields inherited from class org.ametys.plugins.repository.data.holder.group.impl.ModelLessComposite
_defaultDataHolder
Fields inherited from class org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
_repositoryData
-
Constructor Summary
ConstructorDescriptionModifiableModelLessComposite
(AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> typeExtensionPoint, ModifiableRepositoryData repositoryData, ModifiableModelLessDataHolder parent, ModifiableModelLessDataHolder root) Creates a modifiable model free composite -
Method Summary
Modifier and TypeMethodDescriptiongetComposite
(String compositePath) Retrieves the composite at the given pathgetComposite
(String compositePath, boolean createNew) Retrieves the composite at the given pathprotected ModifiableModelLessDataHolder
Retrieves the default implementation of aDataHolder
to useOptional<? extends ModifiableModelLessDataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootRetrieves the repository data used by thisDataHolder
Retrieves theDataHolder
that is the root of the current onevoid
removeValue
(String dataPath) Removes the stored value of the data at the given pathvoid
Sets the value of the data at the given pathvoid
Sets the value of the data at the given pathboolean
synchronizeValues
(Map<String, Object> values) Synchronizes the given values with the current onesMethods inherited from class org.ametys.plugins.repository.data.holder.group.impl.ModelLessComposite
dataToSAX, dataToSAX, getType, getValue, getValue, getValueOfType, getValueOfType, isMultiple
Methods inherited from class org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
copyTo, dataToSAX, getDataNames, hasNonEmptyValue, hasValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX, dataToSAX, getDataNames
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX, dataToSAX, getType, getValue, getValue, getValueOfType, getValueOfType, hasNonEmptyValue, hasValue, isMultiple
-
Field Details
-
_modifiableRepositoryData
The modifiable repository data of this composite -
_modifiableDefaultDataHolder
the default implementation of aModifiableModelLessDataHolder
to use
-
-
Constructor Details
-
ModifiableModelLessComposite
public ModifiableModelLessComposite(AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> typeExtensionPoint, ModifiableRepositoryData repositoryData, ModifiableModelLessDataHolder parent, ModifiableModelLessDataHolder root) Creates a modifiable model free composite- Parameters:
typeExtensionPoint
- the extension point to use to get available element typesrepositoryData
- the repository data to useparent
- the parent of the createdDataHolder
root
- the rootDataHolder
-
-
Method Details
-
getComposite
public ModifiableModelLessComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelLessDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataHolder
- Specified by:
getComposite
in interfaceModelLessDataHolder
- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelLessDataHolder
- Overrides:
getComposite
in classModelLessComposite
- Parameters:
compositePath
- path of the composite to retrieve- Returns:
- the composite or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyBadItemTypeException
- if the stored value at the given path is not a compositeBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
public ModifiableModelLessComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceModifiableDataHolder
- Specified by:
getComposite
in interfaceModifiableModelLessDataHolder
- Parameters:
compositePath
- path of the composite to retrievecreateNew
-true
to create the composite if it does not exist,false
otherwise- Returns:
- the composite or
null
if createNew isfalse
and value not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyBadItemTypeException
- if the stored value at the given path is not a compositeBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiple
-
synchronizeValues
Description copied from interface:ModifiableModelLessDataHolder
Synchronizes the given values with the current ones- Specified by:
synchronizeValues
in interfaceModifiableModelLessDataHolder
- Parameters:
values
- the values to synchronize- Returns:
true
if some values have changed,false
otherwise- Throws:
IOException
- if an error occurs while synchronizing I/O data
-
setValue
public void setValue(String dataPath, Object value) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, UnknownDataException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelLessDataHolder
- Parameters:
dataPath
- path of the datavalue
- the value to set. To empty a value, useModifiableModelLessDataHolder.setValue(String, Object, String)
with anull
value- Throws:
IllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- 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 pointUnknownDataException
- if given the data path is composed of an inexisting groupBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiple
-
setValue
public void setValue(String dataPath, Object value, String dataTypeId) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UnknownDataException, BadDataPathCardinalityException Description copied from interface:ModifiableModelLessDataHolder
Sets the value of the data at the given path- Specified by:
setValue
in interfaceModifiableModelLessDataHolder
- Parameters:
dataPath
- path of the datavalue
- the value to set. Givenull
to empty the value.dataTypeId
- type identifier of the data- Throws:
IllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- 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 setUnknownDataException
- if the given data path is composed of an inexisting groupBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiple
-
removeValue
public void removeValue(String dataPath) throws IllegalArgumentException, UnknownDataException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolder
Removes the stored value of the data at the given path- Specified by:
removeValue
in interfaceModifiableDataHolder
- Specified by:
removeValue
in interfaceModifiableModelLessDataHolder
- Parameters:
dataPath
- path of the data- Throws:
IllegalArgumentException
- if the given data path is null or emptyUnknownDataException
- if the value at the given data path does not existBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiple
-
getParentDataHolder
Description copied from interface:DataHolder
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the root- Specified by:
getParentDataHolder
in interfaceDataHolder
- Specified by:
getParentDataHolder
in interfaceModelLessDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableDataHolder
- Specified by:
getParentDataHolder
in interfaceModifiableModelLessDataHolder
- Overrides:
getParentDataHolder
in classModelLessComposite
- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolder
Retrieves theDataHolder
that is the root of the current one- Specified by:
getRootDataHolder
in interfaceDataHolder
- Specified by:
getRootDataHolder
in interfaceModelLessDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableDataHolder
- Specified by:
getRootDataHolder
in interfaceModifiableModelLessDataHolder
- Overrides:
getRootDataHolder
in classModelLessComposite
- Returns:
- the root
DataHolder
-
getDefaultDataHolder
Description copied from class:AbstractComposite
Retrieves the default implementation of aDataHolder
to use- Overrides:
getDefaultDataHolder
in classModelLessComposite
- Returns:
- the
DataHolder
-
getRepositoryData
Description copied from interface:DataHolder
Retrieves the repository data used by thisDataHolder
- Specified by:
getRepositoryData
in interfaceDataHolder
- Specified by:
getRepositoryData
in interfaceModifiableDataHolder
- Overrides:
getRepositoryData
in classAbstractComposite
- Returns:
- the repository data used by this
DataHolder
-