public abstract class AbstractRepeater extends Object implements Repeater
Modifier and Type | Field and Description |
---|---|
protected RepositoryData |
_repositoryData
Repository data to use to store entries in the repository
|
private static String |
ENTRIES_TEMPORARY_NAME_PREFIX |
Constructor and Description |
---|
AbstractRepeater(RepositoryData repositoryData)
Creates a repeater
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(ModifiableRepeater repeater)
Copies the current
Repeater to the given ModifiableRepeater . |
List<? extends RepeaterEntry> |
getEntries()
Retrieves the repeater entries, sorted by position
|
int |
getSize()
Retrieves the size of the repeater
|
boolean |
hasEntry(int position)
Determines if the repeater has an entry at the given position.
|
protected void |
moveEntries(Map<Integer,Integer> positionsMapping,
ModifiableRepositoryData repeaterData)
Moves the entries according to the given position mapping.
|
protected void |
removeEntry(int position,
ModifiableRepositoryData repositoryData)
Removes the repeater entry at the given position.
|
private static final String ENTRIES_TEMPORARY_NAME_PREFIX
protected RepositoryData _repositoryData
public AbstractRepeater(RepositoryData repositoryData)
repositoryData
- the repository data to usepublic List<? extends RepeaterEntry> getEntries()
Repeater
getEntries
in interface Repeater
public int getSize()
Repeater
public boolean hasEntry(int position)
Repeater
protected void moveEntries(Map<Integer,Integer> positionsMapping, ModifiableRepositoryData repeaterData)
positionsMapping
- the position mappingrepeaterData
- the repository data of the repeaterprotected void removeEntry(int position, ModifiableRepositoryData repositoryData) throws UnknownDataException
position
- The position of the entry to removerepositoryData
- the repository data of the repeaterUnknownDataException
- if there is no entry at this positionpublic void copyTo(ModifiableRepeater repeater) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException
Repeater
Repeater
to the given ModifiableRepeater
.copyTo
in interface Repeater
repeater
- The destination repeater. Can not be null.UndefinedItemPathException
- if one of the copied data is not defined by the model of the destination ModifiableModelAwareRepeater
BadItemTypeException
- if the type defined by the model of the destination ModifiableModelAwareRepeater
doesn't match the copied valueUnknownTypeException
- if there is no available type compatible with the copied value for the type extension point of the destination ModifiableModelLessRepeater
NotUniqueTypeException
- if there is more than one available types compatibles with the copied value for the type extension point of the destination ModifiableModelLessRepeater