public class DefaultJAXXContext extends Object implements JAXXContext
JAXXContext to be used in a JAXXObject by
delegation.
The values are store in a Map but 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 the JAXXContextEntryDef associated with the
value.| Modifier and Type | Field and Description |
|---|---|
protected Map<JAXXContextEntryDef<?>,Object> |
data
les données contenues dans le context
|
protected static JAXXContextEntryDef<JAXXContext> |
PARENT_CONTEXT_ENTRY
entry of the parent context
|
protected JAXXContext |
parentContext
le context parent
|
| Constructor and Description |
|---|
DefaultJAXXContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
<T> T |
getContextValue(Class<T> clazz)
Seek for a unamed entry in the context
This is an exemple to call a method in JAXX :
<JButton onActionPerformed='{getContextValue(Action.class).method(args[])}'/> |
<T> T |
getContextValue(Class<T> clazz,
String name)
Seek for a named entry in the context
|
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 JAXXContext |
getParentContext() |
protected <T> T |
remove0(Class<T> klass,
String name) |
<T> void |
removeContextValue(Class<T> klazz)
Remove from context the value with the given klazz as an unamed entry
|
<T> void |
removeContextValue(Class<T> klazz,
String name)
Remove from context the value with the given klazz as an unamed (if name is null) or named entry
|
<T> void |
setContextValue(T o)
Push in the context a new unamed entry.
|
<T> void |
setContextValue(T o,
String name)
* Push in the context a new amed entry.
|
protected void |
setParentContext(JAXXContext parentContext) |
protected static final JAXXContextEntryDef<JAXXContext> PARENT_CONTEXT_ENTRY
protected JAXXContext parentContext
protected final Map<JAXXContextEntryDef<?>,Object> data
public <T> void setContextValue(T o)
JAXXContextsetContextValue in interface JAXXContextT - type of data to set in contexto - the value to push in contextpublic <T> void setContextValue(T o,
String name)
JAXXContextsetContextValue in interface JAXXContextT - type of data to set in contexto - the value to push in contextname - the name of the new entrypublic <T> T getContextValue(Class<T> clazz)
JAXXContext<JButton onActionPerformed='{getContextValue(Action.class).method(args[])}'/>getContextValue in interface JAXXContextT - type of data to obtain from contextclazz - the class of unamed entry to seek in contextnull if no such entry.public <T> T getContextValue(Class<T> clazz, String name)
JAXXContextgetContextValue in interface JAXXContextT - type of data to obtain from contextclazz - the class of named entry to seek in contextname - the name of the entry to seek in contextnull if no such entry.public <T> void removeContextValue(Class<T> klazz)
JAXXContextremoveContextValue in interface JAXXContextT - type of data to remove from contextklazz - the klazz entrypublic <T> void removeContextValue(Class<T> klazz, String name)
JAXXContextremoveContextValue in interface JAXXContextT - type of data to remove from contextklazz - the klazz entryname - extra name of the entrypublic String[] getKeys(Class<?> klass)
klass - the type of searched keyspublic void clear()
protected JAXXContextEntryDef<?> getKey(String name, Class<?> klass)
protected JAXXContextEntryDef<?> getEntry(Class<?> klass, String name)
protected JAXXContext getParentContext()
protected void setParentContext(JAXXContext parentContext)
Copyright © 2008–2017 Ultreia.io. All rights reserved.