public interface ModelAwareDataAwareAmetysObject extends DataAwareAmetysObject, ModelAwareDataHolder
AmetysObject
that can handle data.Modifier and Type | Method and Description |
---|---|
default ModelAwareComposite |
getComposite(String compositePath)
Retrieves the composite at the given path
|
ModelAwareDataHolder |
getDataHolder()
Returns the
DataHolder of this AmetysObject . |
default ModelAwareRepeater |
getRepeater(String repeaterPath)
Retrieves the repeater at the given path
|
default ModelItemType |
getType(String dataPath)
Retrieves the type of the data at the given path
|
default <T> T |
getValue(String dataPath)
Retrieves the value of the data at the given path
|
default <T> T |
getValue(String dataPath,
boolean useDefaultFromModel,
T defaultValue)
Retrieves the value of the data at the given path, or the default value
|
default boolean |
hasValue(String dataPath)
Checks if there is a value for the data at the given path
|
default boolean |
isMultiple(String path)
Checks if the definition of the element at the given path is multiple
|
copyTo, getDataNames
equals, getId, getName, getParent, getParentPath, getPath, hashCode
toSAX, toSAX
dataToSAX, dataToSAX, dataToSAX, dataToSAX
ModelAwareDataHolder getDataHolder()
DataAwareAmetysObject
DataHolder
of this AmetysObject
.getDataHolder
in interface DataAwareAmetysObject
DataHolder
of this AmetysObject
default ModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
DataHolder
getComposite
in interface DataHolder
getComposite
in interface ModelAwareDataHolder
compositePath
- path of the composite to retrievenull
if not existsIllegalArgumentException
- if the given composite path is null or emptyUndefinedItemPathException
- if the given composite path is not defined by the modelBadItemTypeException
- if the value stored in the repository at the given path is not a compositeBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipledefault ModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
DataHolder
getRepeater
in interface DataHolder
getRepeater
in interface ModelAwareDataHolder
repeaterPath
- path of the repeater to retrievenull
if not existsIllegalArgumentException
- if the given repeater path is null or emptyUndefinedItemPathException
- if the given repeater path is not defined by the modelBadItemTypeException
- if the value stored in the repository at the given path is not a repeaterBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipledefault boolean hasValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException
DataHolder
hasValue
in interface DataAwareAmetysObject
hasValue
in interface DataHolder
hasValue
in interface ModelAwareDataHolder
dataPath
- path of the datatrue
if there is value for the data, false
otherwiseIllegalArgumentException
- 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 multipledefault <T> T getValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
ModelAwareDataHolder
getValue
in interface ModelAwareDataHolder
T
- type of the value to retrievedataPath
- path of the datanull
if not exists. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String.IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the value stored in the repositoryBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipledefault <T> T getValue(String dataPath, boolean useDefaultFromModel, T defaultValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
ModelAwareDataHolder
getValue
in interface ModelAwareDataHolder
T
- type of the value to retrievedataPath
- path of the datauseDefaultFromModel
- true to use the default value from the model, false to use the given default valuedefaultValue
- default value used if value is null and useDefaultFromModel is false, or if there is no default value on modelnull
if not exists.IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the value stored in the repositoryBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipledefault boolean isMultiple(String path) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException
ModelAwareDataHolder
isMultiple
in interface ModelAwareDataHolder
path
- path of the element. No matter if it is a definition or data path (with repeater entry positions)true
if the element is multiple, false
otherwiseIllegalArgumentException
- if the given path is null or emptyUndefinedItemPathException
- if the given path is not defined by the modelBadItemTypeException
default ModelItemType getType(String dataPath) throws IllegalArgumentException, UndefinedItemPathException
ModelAwareDataHolder
getType
in interface ModelAwareDataHolder
dataPath
- path of the data. No matter if it is a definition or data path (with repeater entry positions)IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the model