Package io.vertigo.ui.core
Class AbstractUiListUnmodifiable<O extends io.vertigo.datamodel.structure.model.DtObject>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<UiObject<O>>
-
- io.vertigo.ui.core.AbstractUiListUnmodifiable<O>
-
- Type Parameters:
O
- the type of entity
- All Implemented Interfaces:
UiList<O>
,Serializable
,Iterable<UiObject<O>>
,Collection<UiObject<O>>
,List<UiObject<O>>
- Direct Known Subclasses:
ClusterUiList
,UiListUnmodifiable
public abstract class AbstractUiListUnmodifiable<O extends io.vertigo.datamodel.structure.model.DtObject> extends AbstractList<UiObject<O>> implements UiList<O>, Serializable
Wrapper d'affichage des listes d'objets métier.- Author:
- npiedeloup
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentRef<io.vertigo.datastore.entitystore.EntityStoreManager>
entityStoreManager
Accès au storeManager.protected static int
NB_MAX_ELEMENTS
protected ComponentRef<io.vertigo.commons.transaction.VTransactionManager>
transactionManager
Accès au transactionManager.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
clearUiObjectBuffer()
Vide le buffer des UiObjects (potentiellement modifiés).UiObject<O>
get(int index)
UiObject<O>
getById(String keyFieldName, Serializable keyValue)
Récupère un objet par la valeur de son identifiant.io.vertigo.datamodel.structure.definitions.DtDefinition
getDtDefinition()
String
getIdFieldName()
Class<O>
getObjectType()
protected Collection<UiObject<O>>
getUiObjectBuffer()
int
indexOf(Object o)
protected void
initUiObjectByIdIndex()
Initialize l'index des UiObjects par Id.protected void
initUiObjectByKeyIndex(String keyFieldName)
Initialize l'index des UiObjects par Clé.ArrayList<HashMap<String,Serializable>>
listForClient(Set<String> fieldsForClient, Map<String,Function<Serializable,String>> valueTransformers)
Return a Serializable List for client.protected abstract io.vertigo.datamodel.structure.model.DtList<O>
obtainDtList()
Récupère la liste des elements.protected Map<Serializable,UiObject<O>>
obtainUiObjectByIdMap(String keyFieldName)
Récupère l'index des UiObjects par Id.int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
-
Methods inherited from interface io.vertigo.vega.webservice.model.UiList
checkFormat, mergeAndCheckInput
-
-
-
-
Field Detail
-
NB_MAX_ELEMENTS
protected static final int NB_MAX_ELEMENTS
- See Also:
- Constant Field Values
-
entityStoreManager
protected final ComponentRef<io.vertigo.datastore.entitystore.EntityStoreManager> entityStoreManager
Accès au storeManager.
-
transactionManager
protected final ComponentRef<io.vertigo.commons.transaction.VTransactionManager> transactionManager
Accès au transactionManager.
-
-
Method Detail
-
getObjectType
public Class<O> getObjectType()
- Specified by:
getObjectType
in interfaceUiList<O extends io.vertigo.datamodel.structure.model.DtObject>
-
getIdFieldName
public String getIdFieldName()
-
initUiObjectByIdIndex
protected final void initUiObjectByIdIndex()
Initialize l'index des UiObjects par Id. Attention : nécessite la DtList (appel obtainDtList).
-
initUiObjectByKeyIndex
protected final void initUiObjectByKeyIndex(String keyFieldName)
Initialize l'index des UiObjects par Clé. Attention : nécessite la DtList (appel obtainDtList).- Parameters:
keyFieldName
- Nom du champs à indexer
-
obtainDtList
protected abstract io.vertigo.datamodel.structure.model.DtList<O> obtainDtList()
Récupère la liste des elements. Peut-être appelé souvant : doit assurer un cache local (transient au besoin) si chargement.- Returns:
- Liste des éléments
-
getDtDefinition
public final io.vertigo.datamodel.structure.definitions.DtDefinition getDtDefinition()
- Specified by:
getDtDefinition
in interfaceUiList<O extends io.vertigo.datamodel.structure.model.DtObject>
- Returns:
- DtDefinition de l'objet métier
-
size
public final int size()
- Specified by:
size
in interfaceCollection<O extends io.vertigo.datamodel.structure.model.DtObject>
- Specified by:
size
in interfaceList<O extends io.vertigo.datamodel.structure.model.DtObject>
- Specified by:
size
in classAbstractCollection<UiObject<O extends io.vertigo.datamodel.structure.model.DtObject>>
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interfaceList<O extends io.vertigo.datamodel.structure.model.DtObject>
- Specified by:
indexOf
in interfaceUiList<O extends io.vertigo.datamodel.structure.model.DtObject>
- Overrides:
indexOf
in classAbstractList<UiObject<O extends io.vertigo.datamodel.structure.model.DtObject>>
-
getById
public UiObject<O> getById(String keyFieldName, Serializable keyValue)
Récupère un objet par la valeur de son identifiant. Utilisé par les select, radio et autocomplete en mode ReadOnly.- Parameters:
keyFieldName
- Nom du champ identifiantkeyValue
- Valeur de l'identifiant- Returns:
- UiObject
- Throws:
io.vertigo.datamodel.structure.definitions.FormatterException
- Format error
-
obtainUiObjectByIdMap
protected final Map<Serializable,UiObject<O>> obtainUiObjectByIdMap(String keyFieldName)
Récupère l'index des UiObjects par Id. Calcul l'index si besoin.- Parameters:
keyFieldName
- Nom du champ identifiant- Returns:
- Index des UiObjects par Id
-
getUiObjectBuffer
protected final Collection<UiObject<O>> getUiObjectBuffer()
- Returns:
- Liste des uiObjects bufferisés (potentiellement modifiés).
-
clearUiObjectBuffer
protected final void clearUiObjectBuffer()
Vide le buffer des UiObjects (potentiellement modifiés).
-
listForClient
public ArrayList<HashMap<String,Serializable>> listForClient(Set<String> fieldsForClient, Map<String,Function<Serializable,String>> valueTransformers)
Return a Serializable List for client.- Parameters:
fieldsForClient
- List of fieldsvalueTransformers
- Map of transformers- Returns:
- ArrayList of HashMap (needed for Serializable)
-
-