Package org.nuiton.jaxx.runtime
Interface JAXXContext
-
- All Known Subinterfaces:
JAXXObject
public interface JAXXContextTheJAXXContextcontract defines a generic context. A context contains two king of entries :Unamed entry
a such entry maps filter only on the clas of the object of the entry. To add a unamed entry, usesetContextValue(Object)andgetContextValue(Class)to reteave a such entry.named entry
a such entry filter on class of the object and on the name of the entry. To add a named entry, usesetContextValue(Object, String)andgetContextValue(Class, String)to reteave a such entry.- Author:
- letellier, Tony Chemit - dev@tchemit.fr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TgetContextValue(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> TgetContextValue(Class<T> clazz, String name)Seek for a named entry in the context<T> voidremoveContextValue(Class<T> klazz)Remove from context the value with the given klazz as an unamed entry<T> voidremoveContextValue(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> voidsetContextValue(T o)Push in the context a new unamed entry.<T> voidsetContextValue(T o, String name)* Push in the context a new amed entry.
-
-
-
Method Detail
-
setContextValue
<T> void setContextValue(T o)
Push in the context a new unamed entry. If a previous entry exists in context (unamed and same class), it will be removed.- Type Parameters:
T- type of data to set in context- Parameters:
o- the value to push in context
-
setContextValue
<T> void setContextValue(T o, String name)* Push in the context a new amed entry. If a previous entry exists in context (same name and class), it will be removed.- Type Parameters:
T- type of data to set in context- Parameters:
o- the value to push in contextname- the name of the new entry
-
removeContextValue
<T> void removeContextValue(Class<T> klazz)
Remove from context the value with the given klazz as an unamed entry- Type Parameters:
T- type of data to remove from context- Parameters:
klazz- the klazz entry
-
removeContextValue
<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- Type Parameters:
T- type of data to remove from context- Parameters:
klazz- the klazz entryname- extra name of the entry
-
getContextValue
<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[])}'/>- Type Parameters:
T- type of data to obtain from context- Parameters:
clazz- the class of unamed entry to seek in context- Returns:
- the value of the unamed entry for the given class, or
nullif no such entry.
-
getContextValue
<T> T getContextValue(Class<T> clazz, String name)
Seek for a named entry in the context- Type Parameters:
T- type of data to obtain from context- Parameters:
clazz- the class of named entry to seek in contextname- the name of the entry to seek in context- Returns:
- the value of the named entry for the given class, or
nullif no such entry.
-
-