|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.rees.scope.session.SessionUtil
public class SessionUtil
A utility class that provides static methods that are used internally and for unit testing. Use outside of these contexts should come only as a last resort.
| Constructor Summary | |
|---|---|
SessionUtil()
|
|
| Method Summary | ||
|---|---|---|
static String |
buildKey(String name,
Class<?> clazz)
Given the name of a session-scoped field and its class, this method returns the appropriate key that is used to identify instances of the field in the session-field map. |
|
static void |
extractFields(Object target)
The current values of session fields annotated with SessionField
are extracted from the target object and placed into the session. |
|
static
|
getField(String name,
Class<T> clazz)
Given a session field's name and class, the value of the field is returned from the session. |
|
protected static String |
getSessionFieldName(Field field)
Returns the name of the given field's SessionField |
|
static void |
injectFields(Object target)
The target object's session fields that are annotated with SessionField are injected from the session. |
|
static void |
setField(String name,
Object sessionField)
Given a session field's name and an instance, the value is set for the field in the session. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionUtil()
| Method Detail |
|---|
public static String buildKey(String name,
Class<?> clazz)
name - clazz -
public static <T> T getField(String name,
Class<T> clazz)
T - name - clazz -
public static void setField(String name,
Object sessionField)
fieldName - fieldValue - public static void extractFields(Object target)
SessionField
are extracted from the target object and placed into the session. No
caching
is performed, for use only in unit testing.
target - public static void injectFields(Object target)
SessionField are injected from the session. No caching
is performed, for use only in unit testing.
target - protected static String getSessionFieldName(Field field)
field -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||