Package org.nuiton.jaxx.runtime.context
Class DefaultJAXXContext
- java.lang.Object
-
- org.nuiton.jaxx.runtime.context.DefaultJAXXContext
-
- All Implemented Interfaces:
JAXXContext
- Direct Known Subclasses:
DefaultApplicationContext,JAXXInitialContext
public class DefaultJAXXContext extends Object implements JAXXContext
The defaultJAXXContextto be used in aJAXXObjectby delegation. The values are store in aMapbut we can not use directly the values as key. Because, it does not work if we add for the same object multi entries (named and unamed)... We prefer use as entry theJAXXContextEntryDefassociated with the value.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<JAXXContextEntryDef<?>,Object>datales données contenues dans le contextprotected static JAXXContextEntryDef<JAXXContext>PARENT_CONTEXT_ENTRYentry of the parent contextprotected JAXXContextparentContextle context parent
-
Constructor Summary
Constructors Constructor Description DefaultJAXXContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()<T> TgetContextValue(Class<T> clazz)<T> TgetContextValue(Class<T> clazz, String name)protected JAXXContextEntryDef<?>getEntry(Class<?> klass, String name)protected JAXXContextEntryDef<?>getKey(String name, Class<?> klass)String[]getKeys(Class<?> klass)Obtain all the keys of data for a given type.protected JAXXContextgetParentContext()protected <T> Tremove0(Class<T> klass, String name)<T> voidremoveContextValue(Class<T> klazz)<T> voidremoveContextValue(Class<T> klazz, String name)<T> voidsetContextValue(T o)<T> voidsetContextValue(T o, String name)protected voidsetParentContext(JAXXContext parentContext)
-
-
-
Field Detail
-
PARENT_CONTEXT_ENTRY
protected static final JAXXContextEntryDef<JAXXContext> PARENT_CONTEXT_ENTRY
entry of the parent context
-
parentContext
protected JAXXContext parentContext
le context parent
-
data
protected final Map<JAXXContextEntryDef<?>,Object> data
les données contenues dans le context
-
-
Method Detail
-
setContextValue
public <T> void setContextValue(T o)
- Specified by:
setContextValuein interfaceJAXXContext
-
setContextValue
public <T> void setContextValue(T o, String name)- Specified by:
setContextValuein interfaceJAXXContext
-
getContextValue
public <T> T getContextValue(Class<T> clazz)
- Specified by:
getContextValuein interfaceJAXXContext
-
getContextValue
public <T> T getContextValue(Class<T> clazz, String name)
- Specified by:
getContextValuein interfaceJAXXContext
-
removeContextValue
public <T> void removeContextValue(Class<T> klazz)
- Specified by:
removeContextValuein interfaceJAXXContext
-
removeContextValue
public <T> void removeContextValue(Class<T> klazz, String name)
- Specified by:
removeContextValuein interfaceJAXXContext
-
getKeys
public String[] getKeys(Class<?> klass)
Obtain all the keys of data for a given type.- Parameters:
klass- the type of searched keys- Returns:
- the array of all names of keys for the given type of data
- Since:
- 1.3
-
clear
public void clear()
-
getKey
protected JAXXContextEntryDef<?> getKey(String name, Class<?> klass)
-
getEntry
protected JAXXContextEntryDef<?> getEntry(Class<?> klass, String name)
-
getParentContext
protected JAXXContext getParentContext()
-
setParentContext
protected void setParentContext(JAXXContext parentContext)
-
-