Class SimpleModelAwareAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.SimpleModelAwareAmetysObject<F>
- Type Parameters:
F- the actual type of factory.
- All Implemented Interfaces:
AmetysObject,ModelAwareAmetysObject,ModifiableModelAwareAmetysObject,DataHolder,ModelAwareDataHolder,ModifiableDataHolder,ModifiableModelAwareDataHolder,JCRAmetysObject,ModelAwareJCRAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableAmetysObject,RemovableAmetysObject
- Direct Known Subclasses:
DefaultAmetysObject,SimpleIndexableAmetysObject
public class SimpleModelAwareAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>
extends SimpleAmetysObject<F>
implements ModelAwareJCRAmetysObject
Model aware implementation of an
AmetysObject, backed by a JCR node.-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionSimpleModelAwareAmetysObject(javax.jcr.Node node, String parentPath, F factory) Creates anSimpleModelAwareAmetysObject. -
Method Summary
Modifier and TypeMethodDescriptiondataToJSON(DataContext context) Convert the data contained in thisDataHolderdataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view of the currentDataHolderdataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view in edition mode in the currentDataHolderdataToMap(ViewItemAccessor viewItemAccessor, DataContext context) Retrieves data of this DataHolder as a typed-values Map.voiddataToSAX(ContentHandler contentHandler, DataContext context) Generates SAX events for data contained in thisDataHoldervoiddataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in the currentDataHoldervoiddataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in edition mode in the currentDataHoldergetComposite(String compositePath) Retrieves the composite at the given pathgetComposite(String compositePath, boolean createNew) Retrieves the composite at the given pathprotected ModifiableModelAwareDataHolderReturns theDataHolderof thisAmetysObject.getDefinition(String path) Retrieves the definition of the data at the given pathgetDifferences(Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesgetDifferences(Map<String, Object> values, SynchronizationContext context) Get the collection of model items where there are differences between the given values and the current onesgetDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesgetDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Get the collection of model items where there are differences between the given values and the current onesgetExternalComposite(String compositePath) Retrieves the external composite at the given pathgetExternalComposite(String compositePath, boolean createNew) Retrieves the external composite at the given pathgetExternalRepeater(String repeaterPath) Retrieves the external repeater at the given pathgetExternalRepeater(String repeaterPath, boolean createNew) Retrieves the external repeater at the given path<T> TgetExternalValue(String dataPath) Retrieves the external value of the data at the given pathgetLocalComposite(String compositePath) Retrieves the local composite at the given pathgetLocalComposite(String compositePath, boolean createNew) Retrieves the local composite at the given pathgetLocalRepeater(String repeaterPath) Retrieves the local repeater at the given pathgetLocalRepeater(String repeaterPath, boolean createNew) Retrieves the local repeater at the given path<T> TgetLocalValue(String dataPath) Retrieves the local value of the data at the given pathCollection<? extends Model> getModel()Retrieves the data holder's modelProvide the ModelItemTypeExtensionPoint linked with the DataHolderOptional<? extends ModifiableModelAwareDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootgetRepeater(String repeaterPath) Retrieves the repeater at the given pathgetRepeater(String repeaterPath, boolean createNew) Retrieves the repeater at the given pathRetrieves the repository data used by thisDataHolderRetrieves theDataHolderthat is the root of the current oneRetrieves the status of the externalizable data at the given path Warning: This method won't check that your data is externalizable.<X extends ModelItemType>
XRetrieves the type of the data at the given path<T> TgetValueOfType(String dataPath, String dataTypeId) Retrieves the value of the data at the given path<T> TgetValueOfTypeOrDefault(String dataPath, String dataTypeId, T defaultValue) Retrieves the value of the data at the given path if exists and is not empty, or the given default value<T> TgetValueOrDefault(String dataPath) Retrieves the value of the data at the given path if exists and is not empty, or the default value from the model<T> TgetValueWithMultiValuedPathSegments(String dataPath) Retrieves the value of the data at the given path, allowing multi-valued segments in the path (not necessarily at the last segment) if there is no indicated entry for a repeater, the values of all the entries are retrieved if there are multiple values, all data are retrieved in one arraybooleanhasDefinition(String path) Checks if there is a definition at the given pathbooleanhasDifferences(Map<String, Object> values) Check if there are differences between the given values and the current onesbooleanhasDifferences(Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Check if there are differences between the given values and the current onesbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesbooleanhasExternalValue(String dataPath) Checks if there is a non empty external value for the data at the given pathbooleanhasExternalValueOrEmpty(String dataPath) Checks if there is an external value for the data at the given pathbooleanhasLocalValue(String dataPath) Checks if there is a non empty local value for the data at the given pathbooleanhasLocalValueOrEmpty(String dataPath) Checks if there is a local value for the data at the given pathbooleanChecks if there is a non empty value for the data at the given pathbooleanChecks if there is a non empty value for the data at the given pathbooleanhasValueOrEmpty(String dataPath) Checks if there is a value, even empty, for the data at the given pathbooleanisMultiple(String dataPath) Checks if the value of the data at the given path is multiplebooleanisMultiple(String dataPath, String dataTypeId) Checks if the value of the data at the given path is multiplevoidremoveExternalizableMetadataIfExists(String dataPath) Removes the stored metadata (status and alternative value) for externalizable (or ex-externalizable) datavoidremoveExternalValue(String dataPath) Removes the external value of the data at the given pathvoidremoveLocalValue(String dataPath) Removes the local value of the data at the given pathvoidremoveValue(String dataPath) Removes the stored value of the data at the given pathvoidsetExternalValue(String dataPath, Object externalValue) Sets the external value of the data at the given pathvoidsetLocalValue(String dataPath, Object localValue) Sets the local value of the data at the given pathvoidsetStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) Set the status of the data at the given pathvoidSets the value of the data at the given pathvoidSets the value of the data at the given path<T extends SynchronizationResult>
TsynchronizeValues(Map<String, Object> values) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues(Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Synchronizes the given values with the current ones<T extends SynchronizationResult>
TsynchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the currentModifiableModelAwareDataHolder's onesMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
dataToJSON, dataToSAX, equals, getDataNames, getValue, getValueOrDefault, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getValue, getValueOrDefaultMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, getDataNamesMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolderMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Constructor Details
-
SimpleModelAwareAmetysObject
Creates anSimpleModelAwareAmetysObject.- Parameters:
node- the node backing thisAmetysObjectparentPath- the parentPath in the Ametys hierarchyfactory- theSimpleModelAwareAmetysObjectFactorywhich created the AmetysObject
-
-
Method Details
-
getDataHolder
Description copied from class:AbstractAmetysObjectReturns theDataHolderof thisAmetysObject.- Overrides:
getDataHolderin classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Returns:
- the
DataHolderof thisAmetysObject
-
getComposite
public ModifiableModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- 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 emptyBadItemTypeException- 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
-
getLocalComposite
public ModifiableModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif 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 compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
public ModifiableModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Parameters:
compositePath- path of the externalizable composite to retrieve- Returns:
- the composite or
nullif 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 compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
public ModifiableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
public ModifiableRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
public ModifiableRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given repeater path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComposite
public ModifiableModelAwareComposite getComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- 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 emptyBadItemTypeException- 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
-
getLocalComposite
public ModifiableModelAwareComposite getLocalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Parameters:
compositePath- path of the externalizable 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 emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
public ModifiableModelAwareComposite getExternalComposite(String compositePath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Parameters:
compositePath- path of the externalizable 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 emptyBadItemTypeException- if the stored value at the given path is not a compositeUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
public ModifiableRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
public ModifiableRepeater getLocalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
public ModifiableRepeater getExternalRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrievecreateNew-trueto create the repeater if it does not exist,falseotherwise- Returns:
- the repeater or
nullif createNew isfalseand value not exists or is empty - Throws:
IllegalArgumentException- if the given repeater path is null or emptyBadItemTypeException- if the stored value at the given path is not a repeaterUndefinedItemPathException- if the given composite path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasValue
public boolean hasValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Overrides:
hasValuein classAbstractAmetysObject- Parameters:
dataPath- path of the data- Returns:
trueif there is a non empty value for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- 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
-
hasValue
public boolean hasValue(String dataPath, String dataTypeId) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Specified by:
hasValuein interfaceModelAwareDataHolder- Overrides:
hasValuein classAbstractAmetysObject- Parameters:
dataPath- path of the datadataTypeId- type identifier of the data- Returns:
trueif there is a non empty value for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- 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
-
hasLocalValue
public boolean hasLocalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a non empty local value for the data at the given path- Specified by:
hasLocalValuein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif the data at the given path is defined by the model, if there is a non empty local value for the data and if the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasExternalValue
public boolean hasExternalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a non empty external value for the data at the given path- Specified by:
hasExternalValuein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif the data at the given path is defined by the model, if there is a non empty external value for the data and if the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasValueOrEmpty
public boolean hasValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a value, even empty, for the data at the given path- Specified by:
hasValueOrEmptyin interfaceDataHolder- Overrides:
hasValueOrEmptyin classAbstractAmetysObject- Parameters:
dataPath- path of the data- Returns:
trueif there is value, even empty, for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- 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
-
hasLocalValueOrEmpty
public boolean hasLocalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a local value for the data at the given path- Specified by:
hasLocalValueOrEmptyin interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif the data at the given path is defined by the model, if there is a local value for the data, even empty, and if the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasExternalValueOrEmpty
public boolean hasExternalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is an external value for the data at the given path- Specified by:
hasExternalValueOrEmptyin interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif the data at the given path is defined by the model, if there is an external value for the data, even empty, and if the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalValue
public <T> T getLocalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local value of the data at the given path- Specified by:
getLocalValuein interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the externalizable data- Returns:
- the local value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalValue
public <T> T getExternalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external value of the data at the given path- Specified by:
getExternalValuein interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the externalizable data- Returns:
- the external value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValueOrDefault
public <T> T getValueOrDefault(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the value of the data at the given path if exists and is not empty, or the default value from the model- Specified by:
getValueOrDefaultin interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the data- Returns:
- the value of the data, or the default value from the model if the value does not exist or is empty
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValueOfType
public <T> T getValueOfType(String dataPath, String dataTypeId) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path- Specified by:
getValueOfTypein interfaceDataHolder- Specified by:
getValueOfTypein interfaceModelAwareDataHolder- Overrides:
getValueOfTypein classAbstractAmetysObject- Type Parameters:
T- type of the value to retrieve. Should match the given data type- Parameters:
dataPath- path of the datadataTypeId- type identifier of the data- Returns:
- the value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the given type doesn't match the type of the stored value at the given pathUndefinedItemPathException- if the data holder has a model and the given data 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
-
getValueOfTypeOrDefault
public <T> T getValueOfTypeOrDefault(String dataPath, String dataTypeId, T defaultValue) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path if exists and is not empty, or the given default value- Specified by:
getValueOfTypeOrDefaultin interfaceDataHolder- Specified by:
getValueOfTypeOrDefaultin interfaceModelAwareDataHolder- Overrides:
getValueOfTypeOrDefaultin classAbstractAmetysObject- Type Parameters:
T- type of the value to retrieve. Should match the given data type- Parameters:
dataPath- path of the datadataTypeId- type identifier of the datadefaultValue- default value- Returns:
- the value of the data, or the given default value if the value does not exist or is empty
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the given type doesn't match the type of the stored value at the given pathUndefinedItemPathException- if the data holder has a model and the given data 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
-
getValueWithMultiValuedPathSegments
public <T> T getValueWithMultiValuedPathSegments(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the value of the data at the given path, allowing multi-valued segments in the path (not necessarily at the last segment) if there is no indicated entry for a repeater, the values of all the entries are retrieved if there are multiple values, all data are retrieved in one array- Specified by:
getValueWithMultiValuedPathSegmentsin interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve- Parameters:
dataPath- path of the data- Returns:
- the value of the data
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the managesMultiples boolean isfalseand the definition of a part of the data path is multiple. Only the last part can be multiple
-
getStatus
public ExternalizableDataProvider.ExternalizableDataStatus getStatus(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the status of the externalizable data at the given path Warning: This method won't check that your data is externalizable. But there is no sense to call it with a non externalizable data- Specified by:
getStatusin interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
- the status of the externalizable data at the given path
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the given data path is composed of an item with type defined by the model that doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
isMultiple
public boolean isMultiple(String dataPath) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderChecks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Overrides:
isMultiplein classAbstractAmetysObject- Parameters:
dataPath- path of the data to check- Returns:
trueif the value of the data is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
isMultiple
public boolean isMultiple(String dataPath, String dataTypeId) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderChecks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Overrides:
isMultiplein classAbstractAmetysObject- Parameters:
dataPath- path of the data to checkdataTypeId- type identifier of the data- Returns:
trueif the value of the data is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
getType
public <X extends ModelItemType> X getType(String path) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderRetrieves the type of the data at the given path- Specified by:
getTypein interfaceDataHolder- Specified by:
getTypein interfaceModelAwareDataHolder- Overrides:
getTypein classAbstractAmetysObject- Type Parameters:
X- type of the item type- Parameters:
path- path of the data- Returns:
- the type of the data
- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
getModelItemTypeExtensionPoint
Description copied from interface:DataHolderProvide the ModelItemTypeExtensionPoint linked with the DataHolder- Specified by:
getModelItemTypeExtensionPointin interfaceDataHolder- Specified by:
getModelItemTypeExtensionPointin interfaceModelAwareDataHolder- Overrides:
getModelItemTypeExtensionPointin classAbstractAmetysObject- Returns:
- the extension point
-
getModel
Description copied from interface:ModelAwareDataHolderRetrieves the data holder's model- Specified by:
getModelin interfaceModelAwareAmetysObject- Specified by:
getModelin interfaceModelAwareDataHolder- Returns:
- the data holder's model
-
getDefinition
public ModelItem getDefinition(String path) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:ModelAwareDataHolderRetrieves the definition of the data at the given path- Specified by:
getDefinitionin interfaceModelAwareDataHolder- Parameters:
path- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
- the definition of the data
- Throws:
IllegalArgumentException- if the given path is null or emptyUndefinedItemPathException- if the given path is not defined by the model
-
hasDefinition
Description copied from interface:ModelAwareDataHolderChecks if there is a definition at the given path- Specified by:
hasDefinitionin interfaceModelAwareDataHolder- Parameters:
path- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
trueif there is definition at the given path,falseotherwise- Throws:
IllegalArgumentException- if the given path is null or empty
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, BadItemTypeException Description copied from interface:DataHolderGenerates SAX events for data contained in thisDataHolder- Specified by:
dataToSAXin interfaceDataHolder- Specified by:
dataToSAXin interfaceModelAwareDataHolder- Overrides:
dataToSAXin classAbstractAmetysObject- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventscontext- The context of the data to SAX- Throws:
SAXException- if an error occurs during the SAX events generationBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Description copied from interface:ModelAwareDataHolderGenerates SAX events for the data in the given view in the currentDataHolder- Specified by:
dataToSAXin interfaceModelAwareDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsviewItemAccessor- theViewItemAccessorreferencing the items for which generate SAX eventscontext- The context of the data to SAX- Throws:
SAXException- if an error occurs during the SAX events generationBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToSAXForEdition
public void dataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Description copied from interface:ModelAwareDataHolderGenerates SAX events for the data in the given view in edition mode in the currentDataHolder- Specified by:
dataToSAXForEditionin interfaceModelAwareDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsviewItemAccessor- theViewItemAccessorreferencing the items for which generate SAX eventscontext- The context of the data to SAX- Throws:
SAXException- if an error occurs during the SAX events generationBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToJSON
Description copied from interface:DataHolderConvert the data contained in thisDataHolder- Specified by:
dataToJSONin interfaceDataHolder- Specified by:
dataToJSONin interfaceModelAwareDataHolder- Overrides:
dataToJSONin classAbstractAmetysObject- Parameters:
context- The context of the data to convert- Returns:
- The data of the current
DataHolderas JSON - Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToJSON
public Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view of the currentDataHolder- Specified by:
dataToJSONin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to convertcontext- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToJSONForEdition
public Map<String,Object> dataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view in edition mode in the currentDataHolder- Specified by:
dataToJSONForEditionin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to convertcontext- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToMap
public Map<String,Object> dataToMap(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderRetrieves data of this DataHolder as a typed-values Map.- Specified by:
dataToMapin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to include in the resulting Mapcontext- The context of the data- Returns:
- a Map containing all data.
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
hasDifferences
Description copied from interface:DataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceDataHolder- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Overrides:
hasDifferencesin classAbstractAmetysObject- Parameters:
values- the values to check- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if value doesn't match the data at corresponding path
-
hasDifferences
public boolean hasDifferences(Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
values- the values to checkcontext- the context of the synchronization- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
hasDifferences
public boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to check- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
hasDifferences
public boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to checkcontext- the context of the synchronization- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
Description copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
values- the values to check- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
public Collection<ModelItem> getDifferences(Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
values- the values to checkcontext- the context of the synchronization- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
public Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to check- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
public Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to checkcontext- the context of the synchronization- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values) throws BadItemTypeException, UndefinedItemPathExceptionDescription copied from interface:ModifiableDataHolderSynchronizes the given values with the current ones- Specified by:
synchronizeValuesin interfaceModifiableDataHolder- Overrides:
synchronizeValuesin classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
values- the values to synchronize- Returns:
- the
SynchronizationResult - Throws:
BadItemTypeException- 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
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(Map<String, Object> values, SynchronizationContext context) throws BadItemTypeException, UndefinedItemPathExceptionDescription copied from interface:ModifiableModelAwareDataHolderSynchronizes the given values with the current ones- Specified by:
synchronizeValuesin interfaceModifiableModelAwareDataHolder- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
values- the values to synchronizecontext- the context of the synchronization- Returns:
- the
SynchronizationResult - Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the model
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeException, UndefinedItemPathExceptionDescription copied from interface:ModifiableModelAwareDataHolderSynchronizes the given values with the current ones- Specified by:
synchronizeValuesin interfaceModifiableModelAwareDataHolder- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to synchronizevalues- the values to synchronize- Returns:
- the
SynchronizationResult - Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the model
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeException, UndefinedItemPathExceptionDescription copied from interface:ModifiableModelAwareDataHolderSynchronizes the given values with the currentModifiableModelAwareDataHolder's ones- Specified by:
synchronizeValuesin interfaceModifiableModelAwareDataHolder- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to synchronizevalues- the values to synchronizecontext- the context of the synchronization- Returns:
- the
SynchronizationResult - Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding valueUndefinedItemPathException- if a key in the given Map refers to a data that is not defined by the model
-
setValue
public void setValue(String dataPath, Object value) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderSets the value of the data at the given path- Specified by:
setValuein interfaceModifiableDataHolder- Specified by:
setValuein interfaceModifiableModelAwareDataHolder- Overrides:
setValuein classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- 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 emptyBadItemTypeException- 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
-
setLocalValue
public void setLocalValue(String dataPath, Object localValue) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderSets the local value of the data at the given path- Specified by:
setLocalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable datalocalValue- the local value to set. Givenullto empty the value.- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the given value to setUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setExternalValue
public void setExternalValue(String dataPath, Object externalValue) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderSets the external value of the data at the given path- Specified by:
setExternalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable dataexternalValue- the external value to set. Givenullto empty the value.- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the given value to setUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
setStatus
public void setStatus(String dataPath, ExternalizableDataProvider.ExternalizableDataStatus status) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderSet the status of the data at the given path- Specified by:
setStatusin interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable datastatus- the new status- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if there is a type issue while getting the parent (part of the dataPath without the last segment)UndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition 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, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderSets the value of the data at the given path- Specified by:
setValuein interfaceModifiableDataHolder- Specified by:
setValuein interfaceModifiableModelAwareDataHolder- Overrides:
setValuein classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- 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 emptyBadItemTypeException- 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
public void removeValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableDataHolderRemoves the stored value of the data at the given path- Specified by:
removeValuein interfaceModifiableDataHolder- Overrides:
removeValuein classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Parameters:
dataPath- path of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- 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
-
removeLocalValue
public void removeLocalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRemoves the local value of the data at the given path- Specified by:
removeLocalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the value of the parent of the given path is not an item containerUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeExternalValue
public void removeExternalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRemoves the external value of the data at the given path- Specified by:
removeExternalValuein interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the value of the parent of the given path is not an item containerUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
removeExternalizableMetadataIfExists
public void removeExternalizableMetadataIfExists(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRemoves the stored metadata (status and alternative value) for externalizable (or ex-externalizable) data- Specified by:
removeExternalizableMetadataIfExistsin interfaceModifiableModelAwareDataHolder- Parameters:
dataPath- path of the data- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the value of the parent of the given path is not an item containerUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepositoryData
Description copied from interface:DataHolderRetrieves the repository data used by thisDataHolder- Specified by:
getRepositoryDatain interfaceDataHolder- Specified by:
getRepositoryDatain interfaceModifiableDataHolder- Overrides:
getRepositoryDatain classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Returns:
- the repository data used by this
DataHolder
-
getParentDataHolder
Description copied from interface:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Specified by:
getParentDataHolderin interfaceModifiableDataHolder- Specified by:
getParentDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getParentDataHolderin classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Specified by:
getRootDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getRootDataHolderin classSimpleAmetysObject<F extends SimpleModelAwareAmetysObjectFactory>- Returns:
- the root
DataHolder
-