Class AbstractRepeaterEntry
- java.lang.Object
-
- org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
-
- org.ametys.plugins.repository.data.holder.group.impl.AbstractRepeaterEntry
-
- All Implemented Interfaces:
DataHolder
,Composite
,RepeaterEntry
- Direct Known Subclasses:
ModelAwareRepeaterEntry
public abstract class AbstractRepeaterEntry extends AbstractComposite implements RepeaterEntry
Abstract class for repeater entries
-
-
Field Summary
Fields Modifier and Type Field Description protected ModifiableRepositoryData
_modifiableRepositoryData
The modifiable repository data if the repeater entry is modifiable-
Fields inherited from class org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
_repositoryData
-
-
Constructor Summary
Constructors Constructor Description AbstractRepeaterEntry(RepositoryData repositoryData)
Creates a repeater entry
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_rename(String newName)
int
getPosition()
Retrieves the position of this entry in the repeaterprotected void
setPosition(int newPosition, Repeater repeater)
Sets the position of the entry in the repeater.-
Methods inherited from class org.ametys.plugins.repository.data.holder.group.impl.AbstractComposite
copyTo, dataToSAX, getDataNames, getDefaultDataHolder, getRepositoryData, hasNonEmptyValue, hasValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX, dataToSAX, getComposite, getDataNames, getParentDataHolder, getRepositoryData, getRootDataHolder, hasNonEmptyValue, hasValue
-
-
-
-
Field Detail
-
_modifiableRepositoryData
protected ModifiableRepositoryData _modifiableRepositoryData
The modifiable repository data if the repeater entry is modifiable
-
-
Constructor Detail
-
AbstractRepeaterEntry
public AbstractRepeaterEntry(RepositoryData repositoryData)
Creates a repeater entry- Parameters:
repositoryData
- the repository data of the repeater entry
-
-
Method Detail
-
getPosition
public int getPosition()
Description copied from interface:RepeaterEntry
Retrieves the position of this entry in the repeater- Specified by:
getPosition
in interfaceRepeaterEntry
- Returns:
- the position of this entry in the repeater
-
setPosition
protected void setPosition(int newPosition, Repeater repeater) throws IllegalArgumentException
Sets the position of the entry in the repeater. The position starts at index 1. The position can be an integer between 1 and the repeater size to move an entry from the beginning Or the position can an integer between 0 and - the repeater size to move an entry from the end (0 means at the end, -1 means before the last one and so on)- Parameters:
newPosition
- The new position of the entryrepeater
- the repeater containing this entry- Throws:
IllegalArgumentException
- if the position is not between the negative and positive repeater size
-
-