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, getDataNamesequals, getId, getName, getParent, getParentPath, getPath, hashCodetoSAX, toSAXdataToSAX, dataToSAX, dataToSAX, dataToSAXModelAwareDataHolder getDataHolder()
DataAwareAmetysObjectDataHolder of this AmetysObject.getDataHolder in interface DataAwareAmetysObjectDataHolder of this AmetysObjectdefault ModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException
DataHoldergetComposite in interface DataHoldergetComposite in interface ModelAwareDataHoldercompositePath - 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
DataHoldergetRepeater in interface DataHoldergetRepeater in interface ModelAwareDataHolderrepeaterPath - 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
DataHolderhasValue in interface DataAwareAmetysObjecthasValue in interface DataHolderhasValue in interface ModelAwareDataHolderdataPath - 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
ModelAwareDataHoldergetValue in interface ModelAwareDataHolderT - 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
ModelAwareDataHoldergetValue in interface ModelAwareDataHolderT - 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
ModelAwareDataHolderisMultiple in interface ModelAwareDataHolderpath - 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 modelBadItemTypeExceptiondefault ModelItemType getType(String dataPath) throws IllegalArgumentException, UndefinedItemPathException
ModelAwareDataHoldergetType in interface ModelAwareDataHolderdataPath - 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