Interface ModelAwareDataHolder
- All Superinterfaces:
DataHolder
- All Known Subinterfaces:
CalendarEvent,CalendarResource,CDMEntity,CommentableContent,Content,ContributorCommentableContent,IndexableAmetysObject,IndexableComposite,IndexableDataHolder,IndexableJCRAmetysObject,IndexableRepeaterEntry,ModelAwareAmetysObject,ModelAwareComposite,ModelAwareJCRAmetysObject,ModifiableCalendarEvent,ModifiableContent,ModifiableIndexableAmetysObject,ModifiableIndexableComposite,ModifiableIndexableDataHolder,ModifiableIndexableRepeaterEntry,ModifiableModelAwareAmetysObject,ModifiableModelAwareComposite,ModifiableModelAwareDataHolder,ModifiableRepeaterEntry,ModifiableWebContent,ModifiableWorkflowAwareContent,ProgramItem,ProgramPart,RepeaterEntry,SharedContent,Task,TasksList,Thread,TrashElement,TraversableProgramPart,WebContent,WorkflowAwareContent
- All Known Implementing Classes:
AbstractProgram,AbstractProgramPart,AbstractTraversableProgramPart,Cart,Catalog,Container,ContentBackupAmetysObject,ContentConsistencyResult,ContentValue,Course,CourseList,CoursePart,DefaultAmetysObject,DefaultContent,DefaultIndexableAmetysObject,DefaultIndexableComposite,DefaultIndexableDataHolder,DefaultIndexableRepeaterEntry,DefaultIndexableTraversableAmetysObject,DefaultLockableAmetysObject,DefaultModelAwareComposite,DefaultModelAwareDataHolder,DefaultModifiableIndexableComposite,DefaultModifiableIndexableDataHolder,DefaultModifiableIndexableRepeaterEntry,DefaultModifiableModelAwareComposite,DefaultModifiableModelAwareDataHolder,DefaultModifiableRepeaterEntry,DefaultRepeaterEntry,DefaultSharedContent,DefaultTrashElement,DefaultWebContent,DefaultWorkflowAwareContent,File,Form,FormEntry,FormPageRule,FormQuestion,JCRCalendar,JCRCalendarEvent,JCRCalendarResource,JCRProjectMember,JCRResource,JCRTask,JCRTasksList,JCRThread,ModifiableContentDataHolder,ModifiableDefaultContent,ModifiableDefaultWebContent,OrgUnit,Person,Program,Query,SimpleIndexableAmetysObject,SimpleModelAwareAmetysObject,Site,SubProgram,TaskCalendarEvent
Interface for data containers with models
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionConvert the data contained in thisDataHolderdataToJSON(DataContext context) Convert the data contained in thisDataHolderdataToJSON(ViewItemAccessor viewItemAccessor) Convert the data in the given view of the currentDataHolderdataToJSON(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 currentDataHolderRetrieves all data of this DataHolder as a typed-values Map.dataToMap(DataContext context) Retrieves all data of this DataHolder as a typed-values Map.dataToMap(ViewItemAccessor viewItemAccessor) Retrieves data of this DataHolder as a typed-values Map.dataToMap(ViewItemAccessor viewItemAccessor, DataContext context) Retrieves data of this DataHolder as a typed-values Map.default voiddataToSAX(ContentHandler contentHandler) Generates SAX events for data contained in thisDataHolderdefault voiddataToSAX(ContentHandler contentHandler, DataContext context) Generates SAX events for data contained in thisDataHolderdefault voiddataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor) Generates SAX events for the data in the given view in the currentDataHoldervoiddataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in the currentDataHoldervoiddataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in edition mode in the currentDataHoldergetComposite(String compositePath) Retrieves the composite at the given pathRetrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite datadefault 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 onesgetDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesgetDifferences(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 onesgetExternalComposite(String compositePath) Retrieves the external composite at the given pathgetExternalRepeater(String repeaterPath) Retrieves the external repeater at the given path<T> TgetExternalValue(String dataPath) Retrieves the external value of the data at the given pathgetLocalComposite(String compositePath) Retrieves the local composite at the given pathgetLocalRepeater(String repeaterPath) Retrieves the local repeater at the given path<T> TgetLocalValue(String dataPath) Retrieves the local value of the data at the given pathCollection<? extends ModelItemContainer> getModel()Retrieves the data holder's modeldefault ModelItemTypeExtensionPointProvide the ModelItemTypeExtensionPoint linked with the DataHolderOptional<? extends ModelAwareDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootgetRepeater(String repeaterPath) Retrieves the repeater at the given pathRetrieves 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 value<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 model<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 onesbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Check if there are differences between the given values and the current onesbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesbooleanhasExternalValue(String dataPath) Checks if there is a non empty external value for the data at the given pathbooleanhasExternalValueOrEmpty(String dataPath) Checks if there is an external value for the data at the given pathbooleanhasLocalValue(String dataPath) Checks if there is a non empty local value for the data at the given pathbooleanhasLocalValueOrEmpty(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 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 value of the data at the given path is multipleMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryData, getValue, getValueOrDefault, hasValue, hasValueOrEmpty
-
Field Details
-
ALTERNATIVE_SUFFIX
Suffix used for the alternative value- See Also:
-
STATUS_SUFFIX
Suffix used for the status value- See Also:
-
-
Method Details
-
getComposite
ModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UnknownTypeException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- 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
ModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the local composite at the given path- 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
ModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the external composite at the given path- 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
Repeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the repeater at the given path- 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
Repeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the local repeater at the given path- 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
Repeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the external repeater at the given path- 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
boolean hasLocalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a non empty local value for the data at the given path- 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
boolean hasExternalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a non empty external value for the data at the given path- 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, UnknownTypeException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- 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 emptyUnknownTypeException- if the given type isn't available for this data holder's type extension pointBadDataPathCardinalityException- 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
boolean hasLocalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a local value for the data at the given path- 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
boolean hasExternalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is an external value for the data at the given path- 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
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNamesin interfaceDataHolder- Returns:
- the names of the data contained by this data holder and that are defined by the model
-
getLocalValue
<T> T getLocalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the local value of the data at the given path- 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
<T> T getExternalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the external value of the data at the given path- 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
<T> T getValueOrDefault(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the value of the data at the given path if exists and is not empty, or the default value from the model- 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 Retrieves the value of the data at the given path- Specified by:
getValueOfTypein interfaceDataHolder- 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 Retrieves the value of the data at the given path if exists and is not empty, or the given default value- Specified by:
getValueOfTypeOrDefaultin interfaceDataHolder- 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
<T> T getValueWithMultiValuedPathSegments(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException 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 array- 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
ExternalizableDataProvider.ExternalizableDataStatus getStatus(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves 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- 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 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 multiple- Specified by:
isMultiplein interfaceDataHolder- 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 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 multiple- Specified by:
isMultiplein interfaceDataHolder- 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 dataPath) throws IllegalArgumentException, UnknownDataException, UnknownTypeException, NotUniqueTypeException, UndefinedItemPathException Retrieves the type of the data at the given path- Specified by:
getTypein interfaceDataHolder- Type Parameters:
X- type of the item type- Parameters:
dataPath- 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 interfaceDataHolder- Returns:
- the extension point
-
getModel
Collection<? extends ModelItemContainer> getModel()Retrieves the data holder's model- Returns:
- the data holder's model
-
getDefinition
default ModelItem getDefinition(String path) throws IllegalArgumentException, UndefinedItemPathException Retrieves the definition of the data at the given path- 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
Checks if there is a definition at the given path- 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) throws SAXException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException Generates SAX events for data contained in thisDataHolder
Generates SAX events only for the data in the model- Specified by:
dataToSAXin interfaceDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX events- 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, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException Generates SAX events for data contained in thisDataHolder
Generates SAX events only for the data in the model- Specified by:
dataToSAXin interfaceDataHolder- 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) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in the currentDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsviewItemAccessor- theViewItemAccessorreferencing the items for which generate SAX events- Throws:
SAXException- if an error occurs during the SAX events generationBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToSAX
void dataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in the currentDataHolder- 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
void dataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in edition mode in the currentDataHolder- 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
Convert the data contained in thisDataHolder
Only converts the data in the model- Specified by:
dataToJSONin interfaceDataHolder- Returns:
- The data of the current
DataHolderas JSON - Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToJSON
Convert the data contained in thisDataHolder
Only converts the data in the model- Specified by:
dataToJSONin interfaceDataHolder- 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 Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor) throws BadItemTypeException Convert the data in the given view of the currentDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToJSON
Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Convert the data in the given view of the currentDataHolder- 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
Map<String,Object> dataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Convert the data in the given view in edition mode in the currentDataHolder- 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
Retrieves all data of this DataHolder as a typed-values Map.- Returns:
- a Map containing all data.
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToMap
Retrieves all data of this DataHolder as a typed-values Map.- Parameters:
context- The context of the data- Returns:
- a Map containing all data.
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToMap
Retrieves data of this DataHolder as a typed-values Map.- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to include in the resulting Map- Returns:
- a Map containing all data.
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToMap
Map<String,Object> dataToMap(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Retrieves data of this DataHolder as a typed-values Map.- 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, BadItemTypeExceptionCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceDataHolder- Parameters:
values- 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 valueUnknownTypeException- 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 point
-
hasDifferences
default boolean hasDifferences(Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionCheck if there are differences between the given values and the current ones- 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
boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionCheck if there are differences between the given values and the current ones- 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
boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionCheck if there are differences between the given values and the current ones- 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
Get the collection of model items where there are differences between the given values and the current ones- 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 BadItemTypeExceptionGet the collection of model items where there are differences between the given values and the current ones- 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
Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionGet the collection of model items where there are differences between the given values and the current ones- 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
Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionGet the collection of model items where there are differences between the given values and the current ones- 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
Optional<? extends ModelAwareDataHolder> 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- 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- Returns:
- the root
DataHolder
-