Interface ModelAwareComposite
- All Superinterfaces:
Composite,DataHolder,ModelAwareDataHolder
- All Known Subinterfaces:
IndexableComposite,IndexableRepeaterEntry,ModifiableIndexableComposite,ModifiableIndexableRepeaterEntry,ModifiableModelAwareComposite,ModifiableRepeaterEntry,RepeaterEntry
- All Known Implementing Classes:
DefaultIndexableComposite,DefaultIndexableRepeaterEntry,DefaultModelAwareComposite,DefaultModifiableIndexableComposite,DefaultModifiableIndexableRepeaterEntry,DefaultModifiableModelAwareComposite,DefaultModifiableRepeaterEntry,DefaultRepeaterEntry
Interface for model aware composites
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectdataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdataToJSON(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.default voiddataToSAX(ContentHandler contentHandler, DataContext context) Generates SAX events for data contained in thisDataHolderdefault voiddataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in the currentDataHolderdefault voiddataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in edition mode in the currentDataHolderdefault ModelAwareCompositegetComposite(String compositePath) Retrieves the composite at the given pathdefault Collection<String> Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataRetrieves the default implementation of aDataHolderto usedefault ModelItemgetDefinition(String path) Retrieves the definition of the data at the given pathdefault Collection<ModelItem> getDifferences(Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesdefault Collection<ModelItem> getDifferences(Map<String, Object> values, SynchronizationContext context) Get the collection of model items where there are differences between the given values and the current onesdefault Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesdefault Collection<ModelItem> getDifferences(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 onesdefault ModelAwareCompositegetExternalComposite(String compositePath) Retrieves the external composite at the given pathdefault RepeatergetExternalRepeater(String repeaterPath) Retrieves the external repeater at the given pathdefault <T> TgetExternalValue(String dataPath) Retrieves the external value of the data at the given pathdefault ModelAwareCompositegetLocalComposite(String compositePath) Retrieves the local composite at the given pathdefault RepeatergetLocalRepeater(String repeaterPath) Retrieves the local repeater at the given pathdefault <T> TgetLocalValue(String dataPath) Retrieves the local value of the data at the given pathdefault Collection<? extends ModelItemContainer> getModel()Retrieves the data holder's modeldefault ModelItemTypeExtensionPointProvide the ModelItemTypeExtensionPoint linked with the DataHolderdefault Optional<? extends ModelAwareDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootdefault RepeatergetRepeater(String repeaterPath) Retrieves the repeater at the given pathdefault ModelAwareDataHolderRetrieves 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.default <X extends ModelItemType>
XRetrieves the type of the data at the given pathdefault <T> TgetValueOfType(String dataPath, String dataTypeId) Retrieves the value of the data at the given pathdefault <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 valuedefault <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 modeldefault <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 arraydefault booleanhasDefinition(String path) Checks if there is a definition at the given pathdefault booleanhasDifferences(Map<String, Object> values) Check if there are differences between the given values and the current onesdefault booleanhasDifferences(Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesdefault booleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Check if there are differences between the given values and the current onesdefault booleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesdefault booleanhasExternalValue(String dataPath) Checks if there is a non empty external value for the data at the given pathdefault booleanhasExternalValueOrEmpty(String dataPath) Checks if there is an external value for the data at the given pathdefault booleanhasLocalValue(String dataPath) Checks if there is a non empty local value for the data at the given pathdefault booleanhasLocalValueOrEmpty(String dataPath) Checks if there is a local value for the data at the given pathdefault booleanChecks if there is a non empty value for the data at the given pathdefault booleanisMultiple(String dataPath) Checks if the definition of the element at the given path is multiple
Checks if the definition of the element at the given path is multiple
Checks if the value of the data at the given path is multipledefault booleanisMultiple(String dataPath, String dataTypeId) Checks if the definition of the element at the given path is multiple
Checks if the definition of the element at the given path is multiple
Checks if the value of the data at the given path is multipleMethods inherited from interface org.ametys.plugins.repository.data.holder.group.Composite
dataToSAX, getValue, getValueOrDefault, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToSAX, getRepositoryDataMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX
-
Method Details
-
getComposite
default ModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceComposite- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- 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 emptyUnknownTypeException- if the type composite is not available for this data holderBadItemTypeException- 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
default ModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- 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
default ModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- 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
default Repeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceModelAwareDataHolder- 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
default Repeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- 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
default Repeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- 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
-
hasLocalValue
default 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
default 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
-
hasValue
default 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 interfaceComposite- Specified by:
hasValuein interfaceDataHolder- Specified by:
hasValuein interfaceModelAwareDataHolder- 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
-
hasLocalValueOrEmpty
default 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
default 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
-
getDataNames
Description copied from interface:ModelAwareDataHolderRetrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNamesin interfaceComposite- Specified by:
getDataNamesin interfaceDataHolder- Specified by:
getDataNamesin interfaceModelAwareDataHolder- Returns:
- the names of the data contained by this data holder and that are defined by the model
-
getLocalValue
default <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
default <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
default <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
default <T> T getValueOfType(String dataPath, String dataTypeId) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the value of the data at the given path- Specified by:
getValueOfTypein interfaceComposite- Specified by:
getValueOfTypein interfaceDataHolder- Specified by:
getValueOfTypein 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 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 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 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 multipleNotUniqueTypeException
-
getValueOfTypeOrDefault
default <T> T getValueOfTypeOrDefault(String dataPath, String dataTypeId, T defaultValue) throws IllegalArgumentException, UnknownTypeException, NotUniqueTypeException, 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 given default value- Specified by:
getValueOfTypeOrDefaultin interfaceComposite- Specified by:
getValueOfTypeOrDefaultin interfaceDataHolder- Specified by:
getValueOfTypeOrDefaultin 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 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 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 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 multipleNotUniqueTypeException
-
getValueWithMultiValuedPathSegments
default <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
default 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
default boolean isMultiple(String dataPath) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException, UndefinedItemPathException Description copied from interface:ModelAwareDataHolderChecks if the definition of the element at the given path is multiple
Checks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceComposite- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the element. No matter if it is a definition or data path (with repeater entry positions)- Returns:
trueif the element is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- the data at the given path does not existUnknownTypeException- 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)BadItemTypeException- if value at the sub data path of the given one is not a compositeUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
isMultiple
default boolean isMultiple(String dataPath, String dataTypeId) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException Description copied from interface:ModelAwareDataHolderChecks if the definition of the element at the given path is multiple
Checks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceComposite- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the element. No matter if it is a definition or data path (with repeater entry positions)dataTypeId- type identifier of the data- Returns:
trueif the element is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- the data at the given path does not existUnknownTypeException- if there is no compatible type with the data at the given data pathBadItemTypeException- if value at the sub data path of the given one is not a compositeUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
getType
default <X extends ModelItemType> X getType(String path) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, NotUniqueTypeException, UndefinedItemPathException Description copied from interface:ModelAwareDataHolderRetrieves the type of the data at the given path- Specified by:
getTypein interfaceComposite- Specified by:
getTypein interfaceDataHolder- Specified by:
getTypein interfaceModelAwareDataHolder- Type Parameters:
X- type of the item type- Parameters:
path- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
- the type of the data
- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownDataException- if there is no data stored 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)UndefinedItemPathException- 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 interfaceComposite- Specified by:
getModelItemTypeExtensionPointin interfaceDataHolder- Specified by:
getModelItemTypeExtensionPointin interfaceModelAwareDataHolder- Returns:
- the extension point
-
getModel
Description copied from interface:ModelAwareDataHolderRetrieves the data holder's model- Specified by:
getModelin interfaceModelAwareDataHolder- Returns:
- the data holder's model
-
getDefinition
default 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
default void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException Description copied from interface:ModelAwareDataHolderGenerates SAX events for data contained in thisDataHolder
Generates SAX events only for the data in the model- Specified by:
dataToSAXin interfaceComposite- Specified by:
dataToSAXin interfaceDataHolder- Specified by:
dataToSAXin interfaceModelAwareDataHolder- 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 generationUnknownTypeException- if there is no compatible type with the saxed valueNotUniqueTypeException- if there are many compatible types (there is no way to determine which type is the good one) with the saxed valueBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToSAX
default 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
default 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:ModelAwareDataHolderConvert the data contained in thisDataHolder
Only converts the data in the model- Specified by:
dataToJSONin interfaceComposite- Specified by:
dataToJSONin interfaceDataHolder- Specified by:
dataToJSONin interfaceModelAwareDataHolder- 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
default Object dataToJSON(String dataPath, DataContext context) throws UndefinedItemPathException, BadItemTypeException Description copied from interface:DataHolderConvert the data at the given path into a JSON object- Specified by:
dataToJSONin interfaceComposite- Specified by:
dataToJSONin interfaceDataHolder- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
- Throws:
UndefinedItemPathException- if the data holder has a model and the given data path is not defined by this modelBadItemTypeException- if the value's type does not matches the stored data
-
dataToJSON
default 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
default 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
default 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
default boolean hasDifferences(Map<String, Object> values) throws UnknownTypeException, NotUniqueTypeException, BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceComposite- Specified by:
hasDifferencesin interfaceDataHolder- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
values- the values to check- Returns:
trueif there are differences,falseotherwise- Throws:
UnknownTypeException- if there is no available type compatible with a given value for this data holder's type extension pointNotUniqueTypeException- if there is more than one available types compatibles with the a value for this data holder's type extension pointBadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
hasDifferences
default 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
default 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
default 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
default 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
default 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
default 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
-
getParentDataHolder
Description copied from interface:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceComposite- Specified by:
getParentDataHolderin interfaceDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceComposite- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Returns:
- the root
DataHolder
-
getDefaultDataHolder
Description copied from interface:CompositeRetrieves the default implementation of aDataHolderto use- Specified by:
getDefaultDataHolderin interfaceComposite- Returns:
- the
DataHolder
-