Package org.ametys.cms.data.holder.group
Interface ModifiableIndexableRepeater
- All Superinterfaces:
IndexableRepeater
,ModelAwareRepeater
,ModifiableModelAwareRepeater
,ModifiableRepeater
,Repeater
- All Known Implementing Classes:
DefaultModifiableModelAwareRepeater
public interface ModifiableIndexableRepeater
extends IndexableRepeater, ModifiableModelAwareRepeater
Interface for modifiable indexable 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 ModifiableIndexableRepeaterEntry>
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 repeaterMethods inherited from interface org.ametys.cms.data.holder.group.IndexableRepeater
indexData, indexData
Methods inherited from interface org.ametys.plugins.repository.data.holder.group.ModelAwareRepeater
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDifferences, getDifferences, getModel, hasDifferences, hasDifferences
Methods inherited from interface org.ametys.plugins.repository.data.holder.group.ModifiableModelAwareRepeater
synchronizeValues, synchronizeValues
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, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getSize, hasEntry, hasToMoveEntries
-
Method Details
-
getEntries
List<? extends ModifiableIndexableRepeaterEntry> getEntries()Description copied from interface:Repeater
Retrieves the repeater entries, sorted by position- Specified by:
getEntries
in interfaceIndexableRepeater
- Specified by:
getEntries
in interfaceModelAwareRepeater
- Specified by:
getEntries
in interfaceModifiableModelAwareRepeater
- 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 interfaceIndexableRepeater
- Specified by:
getEntry
in interfaceModelAwareRepeater
- Specified by:
getEntry
in interfaceModifiableModelAwareRepeater
- 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 interfaceModifiableModelAwareRepeater
- 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 interfaceModifiableModelAwareRepeater
- 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
-
getParentDataHolder
Description copied from interface:Repeater
Retrieves the parent of the currentRepeater
- Specified by:
getParentDataHolder
in interfaceIndexableRepeater
- Specified by:
getParentDataHolder
in interfaceModelAwareRepeater
- Specified by:
getParentDataHolder
in interfaceModifiableModelAwareRepeater
- 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 interfaceIndexableRepeater
- Specified by:
getRootDataHolder
in interfaceModelAwareRepeater
- Specified by:
getRootDataHolder
in interfaceModifiableModelAwareRepeater
- Specified by:
getRootDataHolder
in interfaceModifiableRepeater
- Specified by:
getRootDataHolder
in interfaceRepeater
- Returns:
- the root
DataHolder
-