Interface ModifiableModelAwareRepeater
- All Superinterfaces:
ModelAwareRepeater,ModifiableRepeater,Repeater
- All Known Subinterfaces:
ModifiableIndexableRepeater
- All Known Implementing Classes:
DefaultModifiableModelAwareRepeater
Interface for modifiable model aware repeaters
-
Method Summary
Modifier and TypeMethodDescriptionaddEntry()Creates a Repeater entry at the last position.addEntry(int position) Creates a Repeater entry at the given position.List<? extends ModifiableModelAwareRepeaterEntry>Retrieves the repeater entries, sorted by positiongetEntry(int position) Retrieves the repeater entry at the given position.Retrieves the parent of the currentRepeaterRetrieves the rootDataHolderof the current repeaterdefault <T extends SynchronizationResult>
TsynchronizeValues(ViewItemContainer viewItemContainer, SynchronizableRepeater repeaterValues) Synchronizes the given values with each repeater's entry<T extends SynchronizationResult>
TsynchronizeValues(ViewItemContainer viewItemContainer, SynchronizableRepeater repeaterValues, SynchronizationContext context) Synchronizes the given values with each repeater's entryMethods inherited from interface org.ametys.plugins.repository.data.holder.group.ModelAwareRepeater
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToSAX, dataToSAX, dataToSAX, dataToSAX, getModelMethods inherited from interface org.ametys.plugins.repository.data.holder.group.ModifiableRepeater
getRepositoryData, moveEntries, removeEntries, removeEntryMethods inherited from interface org.ametys.plugins.repository.data.holder.group.Repeater
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getSize, hasEntry
-
Method Details
-
getEntries
List<? extends ModifiableModelAwareRepeaterEntry> getEntries()Description copied from interface:RepeaterRetrieves the repeater entries, sorted by position- Specified by:
getEntriesin interfaceModelAwareRepeater- Specified by:
getEntriesin interfaceRepeater- Returns:
- the repeater entries
-
getEntry
Description copied from interface:RepeaterRetrieves the repeater entry at the given position. The position starts at index 1. The position can be an integer between 1 and the repeater size to get an entry from the beginning Or the position can an integer between 0 and - the repeater size to get an entry from the end (0 means at the end, -1 means before the last one and so on)- Specified by:
getEntryin interfaceModelAwareRepeater- Specified by:
getEntryin interfaceModifiableRepeater- Specified by:
getEntryin interfaceRepeater- Parameters:
position- the position of the entry to retrieve- Returns:
- the repeater entry,
nullif there is no entry at this position
-
addEntry
Description copied from interface:ModifiableRepeaterCreates a Repeater entry at the last position.- Specified by:
addEntryin interfaceModifiableRepeater- Returns:
- the created entry
-
addEntry
Description copied from interface:ModifiableRepeaterCreates a Repeater entry at the given position. The position starts at index 1. The position can be an integer between 1 and the repeater size + 1 to insert an entry from the beginning Or the position can an integer between 0 and - the repeater size to insert an entry from the end (0 means at the end, -1 means before the last one and so on)- Specified by:
addEntryin interfaceModifiableRepeater- Parameters:
position- The position of the new entry- Returns:
- the created entry
- Throws:
IllegalArgumentException- if the position is not between the negative and positive repeater size
-
synchronizeValues
default <T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, SynchronizableRepeater repeaterValues) throws UndefinedItemPathException, BadItemTypeException Synchronizes the given values with each repeater's entry- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizerepeaterValues- the values of the repeater to synchronize- Returns:
- the
SynchronizationResult - Throws:
UndefinedItemPathException- if an entry's key refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one entry's key doesn't match the corresponding value
-
synchronizeValues
<T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, SynchronizableRepeater repeaterValues, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeException Synchronizes the given values with each repeater's entry- Type Parameters:
T- the type of theSynchronizationResult- Parameters:
viewItemContainer- TheViewItemContainercontaining all items to synchronizerepeaterValues- the values of the repeater to synchronizecontext- the context of the synchronization- Returns:
- the
SynchronizationResult - Throws:
UndefinedItemPathException- if an entry's key refers to a data that is not defined by the modelBadItemTypeException- if the type defined by the model of one entry's key doesn't match the corresponding value
-
getParentDataHolder
Description copied from interface:RepeaterRetrieves the parent of the currentRepeater- Specified by:
getParentDataHolderin interfaceModelAwareRepeater- Specified by:
getParentDataHolderin interfaceModifiableRepeater- Specified by:
getParentDataHolderin interfaceRepeater- Returns:
- the parent of the current
Repeater
-
getRootDataHolder
Description copied from interface:RepeaterRetrieves the rootDataHolderof the current repeater- Specified by:
getRootDataHolderin interfaceModelAwareRepeater- Specified by:
getRootDataHolderin interfaceModifiableRepeater- Specified by:
getRootDataHolderin interfaceRepeater- Returns:
- the root
DataHolder
-