Package org.ametys.cms.data.holder.impl
Class DefaultModifiableIndexableDataHolder
java.lang.Object
org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
org.ametys.cms.data.holder.impl.DefaultModifiableIndexableDataHolder
- All Implemented Interfaces:
IndexableDataHolder,ModifiableIndexableDataHolder,DataHolder,ModelAwareDataHolder,ModifiableDataHolder,ModifiableModelAwareDataHolder
- Direct Known Subclasses:
ModifiableContentDataHolder
public class DefaultModifiableIndexableDataHolder
extends DefaultModifiableModelAwareDataHolder
implements ModifiableIndexableDataHolder
Default implementation for modifiable and indexable data holder with model.
Extends the repository-level
DefaultModifiableModelAwareDataHolder and adds
CMS-specific behaviour such as Property and system property support.-
Field Summary
Fields inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
_lockableAmetysObject, _modifiableParent, _modifiableRepositoryData, _modifiableRootFields inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
_itemContainers, _parent, _repositoryData, _rootFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers, Optional<LockableAmetysObject> lockableAmetysObject, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root) Creates a default modifiable indexable data holderDefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer) Creates a default modifiable indexable data holderDefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer, Optional<LockableAmetysObject> lockableAmetysObject) Creates a default modifiable indexable data holderDefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer, Optional<LockableAmetysObject> lockableAmetysObject, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root) Creates a default modifiable indexable data holder -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckDefinition(String dataPath, boolean checkStatusAvailable, String errorMsg) Check definition for data pathprotected ModifiableIndexableCompositecreateCompositeInstance(RepositoryData compositeRepositoryData, CompositeDefinition compositeDefinition) Creates an instance of compositeprotected ModifiableIndexableRepeatercreateRepeaterInstance(RepositoryData repeaterRepositoryData, RepeaterDefinition repeaterDefinition) Creates an instance of repeaterprotected ObjectdataToJSON(ModelItem modelItem, String dataPath, DataContext context) Converts the value of the given model item at the given data path to a JSON-serializable objectprotected voiddataToSAX(ContentHandler contentHandler, ModelItem modelItem, String dataPath, DataContext context) Generates SAX events for the given model item at the given data pathgetComposite(String compositePath) Retrieves the composite at the given pathgetComposite(String compositePath, boolean createNew) Retrieves the composite at the given pathprotected ClassRetrieves the class of the managed compositesgetDefinition(String path) Retrieves the definition of the data at the given pathprotected <T> TgetElementValue(ElementDefinition definition, String dataName) Retrieves the value of the given element definitiongetExternalComposite(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 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 pathOptional<? extends ModifiableIndexableDataHolder> 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 pathprotected ClassRetrieves the class of the managed repeatersprotected ClassRetrieves the class of the managed repeater entriesRetrieves theDataHolderthat is the root of the current oneprotected booleanhasValueForName(String dataName, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) Checks if there is a non-empty value for the given simple data name (no path separator) with the given externalizable statusprotected booleanhasValueOrEmptyForName(String dataName, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) Checks if there is a value (possibly empty) for the given simple data name (no path separator) with the given externalizable statusMethods inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
checkModifiableDefinition, createSetValueResultInstance, doRemoveValue, doSynchronizeValues, getComposite, getComposite, getComposite, getRepeater, getRepeater, getRepeater, getRepositoryData, removeExternalizableMetadataIfExists, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, removeValue, removeValueForSynchronize, setElementValue, setExternalValue, setLocalValue, setStatus, setStatus, setStatus, setStatus, setValue, setValue, setValueForSynchronize, synchronizeElement, synchronizeGroup, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues, updateStatusForSynchronizeMethods inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
checkDefinition, checkElementDifferences, checkElementDifferencesInRemoveMode, checkStatusDifferences, createSynchronizationContextInstance, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAX, dataToSAXForEdition, doesHaveDifferences, doGetDifferences, ensureNonNullItemContainers, getCompositeFromValue, getDataNames, getDifferences, getDifferences, getDifferencesInGroup, getExternalValue, getFinalDataName, getGroupValue, getLocalValue, getManagedClass, getModel, getMultipleValues, getRepeaterFromValue, getStatus, getValue, getValue, getValueOrDefault, getValueOrDefault, getValueWithMultiValuedPathSegments, hasDefaultValue, hasDifferences, hasDifferences, hasDifferencesInElement, hasDifferencesInGroup, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValue, hasValueOrEmpty, hasValueOrEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getValue, getValueOrDefault, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDataNames, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getModelItemTypeExtensionPoint, getStatus, getType, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, getValueWithMultiValuedPathSegments, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryData, removeValue, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder
removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, setExternalValue, setLocalValue, setStatus, setValue, setValue, synchronizeValues, synchronizeValues, synchronizeValues
-
Constructor Details
-
DefaultModifiableIndexableDataHolder
public DefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer) Creates a default modifiable indexable data holder- Parameters:
repositoryData- the repository data to useitemContainer- the model container to use to get information about definitions
-
DefaultModifiableIndexableDataHolder
public DefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer, Optional<LockableAmetysObject> lockableAmetysObject) Creates a default modifiable indexable data holder- Parameters:
repositoryData- the repository data to useitemContainer- the model container to use to get information about definitionslockableAmetysObject- the ametys object that can be locked on data modification
-
DefaultModifiableIndexableDataHolder
public DefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, ModelItemContainer itemContainer, Optional<LockableAmetysObject> lockableAmetysObject, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root) Creates a default modifiable indexable data holder- Parameters:
repositoryData- the repository data to useitemContainer- the model container to use to get information about definitionslockableAmetysObject- the ametys object that can be locked on data modificationparent- the optional parentModifiableIndexableDataHolderroot- the rootModifiableIndexableDataHolder
-
DefaultModifiableIndexableDataHolder
public DefaultModifiableIndexableDataHolder(ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers, Optional<LockableAmetysObject> lockableAmetysObject, Optional<? extends ModifiableIndexableDataHolder> parent, Optional<? extends ModifiableIndexableDataHolder> root) Creates a default modifiable indexable data holder- Parameters:
repositoryData- the repository data to useitemContainers- the model containers to use to get information about definitionslockableAmetysObject- the ametys object that can be locked on data modificationparent- the optional parentModifiableIndexableDataHolderroot- the rootModifiableIndexableDataHolder
-
-
Method Details
-
getComposite
public ModifiableIndexableComposite 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 interfaceIndexableDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- Specified by:
getCompositein interfaceModifiableDataHolder- Specified by:
getCompositein interfaceModifiableIndexableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceIndexableDataHolder- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Specified by:
getLocalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getLocalCompositein classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceIndexableDataHolder- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Specified by:
getExternalCompositein interfaceModifiableIndexableDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getExternalCompositein classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceIndexableDataHolder- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Specified by:
getRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getRepeaterin classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getLocalRepeaterin classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getExternalRepeaterin classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableComposite 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 interfaceModifiableIndexableDataHolder- Specified by:
getCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getCompositein classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableComposite 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 interfaceModifiableIndexableDataHolder- Specified by:
getLocalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getLocalCompositein classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableComposite 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 interfaceModifiableIndexableDataHolder- Specified by:
getExternalCompositein interfaceModifiableModelAwareDataHolder- Overrides:
getExternalCompositein classDefaultModifiableModelAwareDataHolder- 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
-
createCompositeInstance
protected ModifiableIndexableComposite createCompositeInstance(RepositoryData compositeRepositoryData, CompositeDefinition compositeDefinition) Description copied from class:DefaultModelAwareDataHolderCreates an instance of composite- Overrides:
createCompositeInstancein classDefaultModifiableModelAwareDataHolder- Parameters:
compositeRepositoryData- the repository data of the composite to createcompositeDefinition- the definition of the composite to create- Returns:
- the created composite instance
-
getRepeater
public ModifiableIndexableRepeater getRepeater(String repeaterPath, boolean createNew) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModifiableModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModifiableIndexableDataHolder- Specified by:
getRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getRepeaterin classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableRepeater 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 interfaceModifiableIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getLocalRepeaterin classDefaultModifiableModelAwareDataHolder- 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 ModifiableIndexableRepeater 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 interfaceModifiableIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModifiableModelAwareDataHolder- Overrides:
getExternalRepeaterin classDefaultModifiableModelAwareDataHolder- 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
-
createRepeaterInstance
protected ModifiableIndexableRepeater createRepeaterInstance(RepositoryData repeaterRepositoryData, RepeaterDefinition repeaterDefinition) Description copied from class:DefaultModelAwareDataHolderCreates an instance of repeater- Overrides:
createRepeaterInstancein classDefaultModifiableModelAwareDataHolder- Parameters:
repeaterRepositoryData- the repository data of the repeater to createrepeaterDefinition- the definition of the repeater to create- Returns:
- the created repeater instance
-
hasValueForName
protected boolean hasValueForName(String dataName, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) Description copied from class:DefaultModelAwareDataHolderChecks if there is a non-empty value for the given simple data name (no path separator) with the given externalizable status- Overrides:
hasValueForNamein classDefaultModelAwareDataHolder- Parameters:
dataName- the name of the data (no path separator)status- the optional externalizable status to filter on, or empty to check the current value- Returns:
trueif there is a non-empty value for the given name,falseotherwise
-
hasValueOrEmptyForName
protected boolean hasValueOrEmptyForName(String dataName, Optional<ExternalizableDataProvider.ExternalizableDataStatus> status) Description copied from class:DefaultModelAwareDataHolderChecks if there is a value (possibly empty) for the given simple data name (no path separator) with the given externalizable status- Overrides:
hasValueOrEmptyForNamein classDefaultModelAwareDataHolder- Parameters:
dataName- the name of the data (no path separator)status- the optional externalizable status to filter on, or empty to check the current value- Returns:
trueif there is a value for the given name (even empty),falseotherwise
-
getElementValue
Description copied from class:DefaultModelAwareDataHolderRetrieves the value of the given element definition- Overrides:
getElementValuein classDefaultModelAwareDataHolder- Type Parameters:
T- the expected type of the value- Parameters:
definition- the definition of the elementdataName- the final name (possibly altered with a status suffix) to use to read the repository data- Returns:
- the value read from the repository, possibly coerced from single to multiple or vice versa
-
getCompositeClass
Description copied from class:DefaultModelAwareDataHolderRetrieves the class of the managed composites- Overrides:
getCompositeClassin classDefaultModifiableModelAwareDataHolder- Returns:
- the class of the managed composites
-
getRepeaterClass
Description copied from class:DefaultModelAwareDataHolderRetrieves the class of the managed repeaters- Overrides:
getRepeaterClassin classDefaultModifiableModelAwareDataHolder- Returns:
- the class of the managed repeaters
-
getRepeaterEntryClass
Description copied from class:DefaultModelAwareDataHolderRetrieves the class of the managed repeater entries- Overrides:
getRepeaterEntryClassin classDefaultModifiableModelAwareDataHolder- Returns:
- the class of the managed repeater entries
-
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
-
dataToSAX
protected void dataToSAX(ContentHandler contentHandler, ModelItem modelItem, String dataPath, DataContext context) throws SAXException, BadItemTypeException Description copied from class:DefaultModelAwareDataHolderGenerates SAX events for the given model item at the given data path- Overrides:
dataToSAXin classDefaultModelAwareDataHolder- Parameters:
contentHandler- the content handler to use to generate SAX eventsmodelItem- the model item describing the datadataPath- the path of the datacontext- the context of the data- Throws:
SAXException- if an error occurs while generating SAX eventsBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToJSON
protected Object dataToJSON(ModelItem modelItem, String dataPath, DataContext context) throws BadItemTypeException Description copied from class:DefaultModelAwareDataHolderConverts the value of the given model item at the given data path to a JSON-serializable object- Overrides:
dataToJSONin classDefaultModelAwareDataHolder- Parameters:
modelItem- the model item describing the datadataPath- the path of the datacontext- the context of the data- Returns:
- the JSON-serializable representation of the value, or
nullif there is no value - Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
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 interfaceIndexableDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Specified by:
getParentDataHolderin interfaceModifiableDataHolder- Specified by:
getParentDataHolderin interfaceModifiableIndexableDataHolder- Specified by:
getParentDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getParentDataHolderin classDefaultModifiableModelAwareDataHolder- 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 interfaceIndexableDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Specified by:
getRootDataHolderin interfaceModifiableDataHolder- Specified by:
getRootDataHolderin interfaceModifiableIndexableDataHolder- Specified by:
getRootDataHolderin interfaceModifiableModelAwareDataHolder- Overrides:
getRootDataHolderin classDefaultModifiableModelAwareDataHolder- Returns:
- the root
DataHolder
-
checkDefinition
Description copied from class:DefaultModelAwareDataHolderCheck definition for data path- Overrides:
checkDefinitionin classDefaultModelAwareDataHolder- Parameters:
dataPath- the data pathcheckStatusAvailable-trueto check if the definition supports externalizable data statuserrorMsg- the error message to throw
-