jaxx.runtime
Interface JAXXContext

All Known Subinterfaces:
JAXXObject
All Known Implementing Classes:
DefaultApplicationContext, DefaultJAXXContext, JAXXInitialContext

public interface JAXXContext

The JAXXContext contract 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, use setContextValue(Object) and getContextValue(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, use setContextValue(Object,String) and getContextValue(Class,String) to reteave a such entry.

Author:
letellier, chemit

Method Summary
<T> T
getContextValue(java.lang.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(java.lang.Class<T> clazz, java.lang.String name)
          Seek for a named entry in the context
<T> void
removeContextValue(java.lang.Class<T> klazz)
          Remove from context the value with the given klazz as an unamed entry
<T> void
removeContextValue(java.lang.Class<T> klazz, java.lang.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, java.lang.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,
                         java.lang.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 context
name - the name of the new entry

removeContextValue

<T> void removeContextValue(java.lang.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(java.lang.Class<T> klazz,
                            java.lang.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 entry
name - extra name of the entry

getContextValue

<T> T getContextValue(java.lang.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 null if no such entry.

getContextValue

<T> T getContextValue(java.lang.Class<T> clazz,
                      java.lang.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 context
name - the name of the entry to seek in context
Returns:
the value of the named entry for the given class, or null if no such entry.


Copyright © 2008-2009 CodeLutin. All Rights Reserved.