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 currentRepeater
Retrieves the rootDataHolder
of 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, getModel
Methods inherited from interface org.ametys.plugins.repository.data.holder.group.ModifiableRepeater
getRepositoryData, moveEntries, removeEntries, removeEntry
Methods 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:Repeater
Retrieves the repeater entries, sorted by position- Specified by:
getEntries
in interfaceModelAwareRepeater
- Specified by:
getEntries
in interfaceRepeater
- Returns:
- the repeater entries
-
getEntry
Description copied from interface:Repeater
Retrieves 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:
getEntry
in interfaceModelAwareRepeater
- Specified by:
getEntry
in interfaceModifiableRepeater
- Specified by:
getEntry
in interfaceRepeater
- Parameters:
position
- the position of the entry to retrieve- Returns:
- the repeater entry,
null
if there is no entry at this position
-
addEntry
Description copied from interface:ModifiableRepeater
Creates a Repeater entry at the last position.- Specified by:
addEntry
in interfaceModifiableRepeater
- Returns:
- the created entry
-
addEntry
Description copied from interface:ModifiableRepeater
Creates 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:
addEntry
in 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
- TheViewItemContainer
containing 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
- TheViewItemContainer
containing 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:Repeater
Retrieves the parent of the currentRepeater
- Specified by:
getParentDataHolder
in interfaceModelAwareRepeater
- Specified by:
getParentDataHolder
in interfaceModifiableRepeater
- Specified by:
getParentDataHolder
in interfaceRepeater
- Returns:
- the parent of the current
Repeater
-
getRootDataHolder
Description copied from interface:Repeater
Retrieves the rootDataHolder
of the current repeater- Specified by:
getRootDataHolder
in interfaceModelAwareRepeater
- Specified by:
getRootDataHolder
in interfaceModifiableRepeater
- Specified by:
getRootDataHolder
in interfaceRepeater
- Returns:
- the root
DataHolder
-