Package io.vertigo.ui.core
Class ViewContextMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Serializable>
-
- io.vertigo.ui.core.ViewContextMap
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,Serializable>
public final class ViewContextMap extends HashMap<String,Serializable>
Liste des couples (clé, object) enregistrés.- Author:
- npiedeloup
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ViewContextMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyForClient(String object, boolean modifiable)
void
addKeyForClient(String object, String fieldName, String rowIndex, boolean modifiable)
void
addListValueTransformer(String objectKey, String objectFieldName, String listKey, String listKeyFieldName, String listDisplayFieldName)
void
addProtectedValueTransformer(String objectKey, String objectFieldName)
void
addTypeForKey(String key, Type paramType)
void
checkErrors(String contextKey, UiMessageStack uiMessageStack)
Vérifie les erreurs de l'objet.boolean
containsKey(Object key)
String
findKey(io.vertigo.datamodel.structure.model.DtObject dtObject)
String
findKey(UiObject<?> uiObject)
Serializable
get(Object key)
Boolean
getBoolean(String key)
String
getId()
Integer
getInteger(String key)
Long
getLong(String key)
String
getString(String key)
<O extends io.vertigo.datamodel.structure.model.DtObject>
UiList<O>getUiList(String key)
<O extends io.vertigo.datamodel.structure.model.DtObject>
BasicUiListModifiable<O>getUiListModifiable(String key)
<O extends io.vertigo.datamodel.structure.model.DtObject>
UiObject<O>getUiObject(String key)
ViewContextMap
getVContext()
boolean
isDirty()
void
makeModifiable()
Génère un nouvel Id et passe le context en modifiable.void
makeUnmodifiable()
passe le context en non-modifiable.void
markDirty()
Mark this context as Dirty : shouldn't be stored and keep old id.String
obtainFkList(String objectKey, String objectFieldName)
<O extends io.vertigo.datamodel.structure.model.DtObject>
voidpublish(String contextKey, O dto)
Ajoute un objet de type form au context.Serializable
put(String key, Serializable value)
<O extends io.vertigo.datamodel.structure.model.DtObject>
OreadDto(String contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack)
<O extends io.vertigo.datamodel.structure.model.DtObject>
OreadDto(String contextKey, UiMessageStack uiMessageStack)
Serializable
remove(Object key)
void
setJsonEngine(JsonEngine jsonEngine)
ViewContextUpdateSecurity
viewContextUpdateSecurity()
Fixe le mode d'update : filtré ou non (par les champs éditables de l'ihm).-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
CTX
public static final String CTX
Clée de l'id de context dans le context.- See Also:
- Constant Field Values
-
INPUT_CTX
public static final String INPUT_CTX
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
public Serializable get(Object key)
- Specified by:
get
in interfaceMap<String,Serializable>
- Overrides:
get
in classHashMap<String,Serializable>
-
getUiObject
public <O extends io.vertigo.datamodel.structure.model.DtObject> UiObject<O> getUiObject(String key)
- Parameters:
key
- Clé de context- Returns:
- UiObject du context
-
getUiList
public <O extends io.vertigo.datamodel.structure.model.DtObject> UiList<O> getUiList(String key)
- Parameters:
key
- Clé de context- Returns:
- UiList du context
-
getUiListModifiable
public <O extends io.vertigo.datamodel.structure.model.DtObject> BasicUiListModifiable<O> getUiListModifiable(String key)
- Parameters:
key
- Clé de context- Returns:
- UiListModifiable du context
-
getString
public String getString(String key)
- Parameters:
key
- Clé de context- Returns:
- String du context
-
getInteger
public Integer getInteger(String key)
- Parameters:
key
- Clé de context- Returns:
- Integer du context
-
getBoolean
public Boolean getBoolean(String key)
- Parameters:
key
- Clé de context- Returns:
- Boolean du context
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Serializable>
- Overrides:
containsKey
in classHashMap<String,Serializable>
-
findKey
public String findKey(UiObject<?> uiObject)
- Parameters:
uiObject
- UiObject recherché- Returns:
- Clé de context de l'élément (null si non trouvé)
-
findKey
public String findKey(io.vertigo.datamodel.structure.model.DtObject dtObject)
- Parameters:
dtObject
- DtObject recherché- Returns:
- Clé de context de l'élément (null si non trouvé)
-
put
public Serializable put(String key, Serializable value)
- Specified by:
put
in interfaceMap<String,Serializable>
- Overrides:
put
in classHashMap<String,Serializable>
-
remove
public Serializable remove(Object key)
- Specified by:
remove
in interfaceMap<String,Serializable>
- Overrides:
remove
in classHashMap<String,Serializable>
-
getId
public String getId()
- Returns:
- Clé de ce context
-
viewContextUpdateSecurity
public ViewContextUpdateSecurity viewContextUpdateSecurity()
Fixe le mode d'update : filtré ou non (par les champs éditables de l'ihm).
-
makeModifiable
public void makeModifiable()
Génère un nouvel Id et passe le context en modifiable.
-
makeUnmodifiable
public void makeUnmodifiable()
passe le context en non-modifiable.
-
markDirty
public void markDirty()
Mark this context as Dirty : shouldn't be stored and keep old id.
-
isDirty
public boolean isDirty()
- Returns:
- if context dirty : shouldn't be stored and keep old id
-
getVContext
public ViewContextMap getVContext()
-
publish
public <O extends io.vertigo.datamodel.structure.model.DtObject> void publish(String contextKey, O dto)
Ajoute un objet de type form au context.- Parameters:
dto
- Objet à publier
-
checkErrors
public void checkErrors(String contextKey, UiMessageStack uiMessageStack)
Vérifie les erreurs de l'objet. Celles-ci sont ajoutées à l'uiMessageStack si nécessaire.
-
readDto
public <O extends io.vertigo.datamodel.structure.model.DtObject> O readDto(String contextKey, UiMessageStack uiMessageStack)
- Returns:
- objet métier validé. Lance une exception si erreur.
-
readDto
public <O extends io.vertigo.datamodel.structure.model.DtObject> O readDto(String contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack)
- Returns:
- objet métier validé. Lance une exception si erreur.
-
addKeyForClient
public void addKeyForClient(String object, String fieldName, String rowIndex, boolean modifiable)
-
addKeyForClient
public void addKeyForClient(String object, boolean modifiable)
-
addProtectedValueTransformer
public void addProtectedValueTransformer(String objectKey, String objectFieldName)
-
addListValueTransformer
public void addListValueTransformer(String objectKey, String objectFieldName, String listKey, String listKeyFieldName, String listDisplayFieldName)
-
setJsonEngine
public void setJsonEngine(JsonEngine jsonEngine)
-
-