public class ModelLessRepeaterEntry extends AbstractRepeaterEntry implements ModelLessDataHolder
Modifier and Type | Field and Description |
---|---|
protected ModelLessDataHolder |
_defaultDataHolder
the default implementation of a
ModelLessDataHolder to use |
_modifiableRepositoryData
_repositoryData
Constructor and Description |
---|
ModelLessRepeaterEntry(AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> typeExtensionPoint,
RepositoryData repositoryData)
Creates a model free repeater entry
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(ModifiableDataHolder dataHolder)
Copies the current
DataHolder to the given ModifiableModelAwareDataHolder . |
ModelLessComposite |
getComposite(String compositePath)
Retrieves the composite at the given path
|
protected ModelLessDataHolder |
getDefaultDataHolder()
Retrieves the default implementation of a
DataHolder to use |
ModelLessRepeater |
getRepeater(String repeaterPath)
Retrieves the repeater at the given path
|
ModelItemType |
getType(String dataPath)
Retrieves the type of the data at the given path
|
<T> T |
getValue(String dataPath)
Retrieves the value of the data at the given path
The type of the value will be deduced from the stored data.
|
<T> T |
getValue(String dataPath,
T defaultValue)
Retrieves the value of the data at the given path, or the default value
|
<T> T |
getValueOfType(String dataPath,
String dataTypeId)
Retrieves the value of the data at the given path
|
<T> T |
getValueOfType(String dataPath,
String dataTypeId,
T defaultValue)
Retrieves the value of the data at the given path, or the default value
|
boolean |
isMultiple(String dataPath)
Checks if the value of the data at the given path is multiple
|
getPosition, setPosition
getDataNames, hasValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasValue, toSAX, toSAX
dataToSAX, dataToSAX, dataToSAX, dataToSAX, getDataNames
protected ModelLessDataHolder _defaultDataHolder
ModelLessDataHolder
to usepublic ModelLessRepeaterEntry(AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> typeExtensionPoint, RepositoryData repositoryData)
typeExtensionPoint
- the extension point to use to get available element typesrepositoryData
- the repository data to usepublic ModelLessComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getComposite
in interface DataHolder
getComposite
in interface ModelLessDataHolder
compositePath
- path of the composite to retrievenull
if not existsIllegalArgumentException
- if the given composite path is null or emptyBadItemTypeException
- if the value stored in the repository at the given path is not a compositeBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic ModelLessRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getRepeater
in interface DataHolder
getRepeater
in interface ModelLessDataHolder
repeaterPath
- path of the repeater to retrievenull
if not existsIllegalArgumentException
- if the given repeater path is null or emptyBadItemTypeException
- if the value stored in the repository at the given path is not a repeaterBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic <T> T getValue(String dataPath) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getValue
in interface ModelLessDataHolder
T
- type of the value to retrieve. Should match the given data typedataPath
- path of the datanull
if not exists. The object returned may be of a generic class defined by the storage. For example, an url may be returned as a String. Use the 2 arguments version to ensure to get the right kind of Object.IllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- if there is no compatible type with the data at the given data pathNotUniqueTypeException
- if there are many compatible types (there is no way to determine which type is the good one)BadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic <T> T getValue(String dataPath, T defaultValue) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getValue
in interface ModelLessDataHolder
T
- type of the value to retrieve. Should match the given data typedataPath
- path of the datadefaultValue
- default valueIllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- if there is no compatible type with the data at the given data pathNotUniqueTypeException
- if there are many compatible types (there is no way to determine which type is the good one)BadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic <T> T getValueOfType(String dataPath, String dataTypeId) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getValueOfType
in interface ModelLessDataHolder
T
- type of the value to retrieve. Should match the given data typedataPath
- path of the datadataTypeId
- type identifier of the datanull
if not existsIllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- if the given type isn't available for this data holder's type extension pointBadItemTypeException
- if the given type doesn't match the type of the value stored in the repository at the given pathBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic <T> T getValueOfType(String dataPath, String dataTypeId, T defaultValue) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getValueOfType
in interface ModelLessDataHolder
T
- type of the value to retrieve. Should match the given data typedataPath
- path of the datadataTypeId
- type identifier of the datadefaultValue
- default valueIllegalArgumentException
- if the given data path is null or emptyUnknownTypeException
- if the given type isn't available for this data holder's type extension pointBadItemTypeException
- if the given type doesn't match the type of the value stored in the repository at the given pathBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic boolean isMultiple(String dataPath) throws IllegalArgumentException, UnknownDataException, BadDataPathCardinalityException
ModelLessDataHolder
isMultiple
in interface ModelLessDataHolder
dataPath
- path of the data to checktrue
if the value of the data is multiple, false
otherwiseIllegalArgumentException
- if the given data path is null or emptyUnknownDataException
- the data at the given path does not existBadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic ModelItemType getType(String dataPath) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, NotUniqueTypeException, BadDataPathCardinalityException
ModelLessDataHolder
getType
in interface ModelLessDataHolder
dataPath
- path of the dataIllegalArgumentException
- if the given data path is null or emptyUnknownDataException
- if there is no data in the repository at the given pathUnknownTypeException
- if there is no compatible type with the data at the given data path or if the data is a repeater entry but the composite type is not availableNotUniqueTypeException
- if there are many compatible types (there is no way to determine which type is the good one)BadDataPathCardinalityException
- if the value of a part of the data path is multiple. Only the last part can be multiplepublic void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException
DataHolder
DataHolder
to the given ModifiableModelAwareDataHolder
.copyTo
in interface DataHolder
dataHolder
- The destination dataHolder. Can not be null.UndefinedItemPathException
- if one of the copied data is not defined by the model of the destination ModifiableModelAwareDataHolder
BadItemTypeException
- if the type defined by the model of the destination ModifiableModelAwareDataHolder
doesn't match the copied valueUnknownTypeException
- if there is no available type compatible with the copied value for the type extension point of the destination ModifiableModelLessDataHolder
NotUniqueTypeException
- if there is more than one available types compatibles with the copied value for the type extension point of the destination ModifiableModelLessDataHolder
protected ModelLessDataHolder getDefaultDataHolder()
AbstractComposite
DataHolder
to usegetDefaultDataHolder
in class AbstractComposite
DataHolder