com.oldlight.weaver.clientbinding
Class WeaverAttributeUtil
java.lang.Object
com.oldlight.weaver.clientbinding.WeaverAttributeUtil
- public class WeaverAttributeUtil
- extends Object
This is a utility class for dealing with scoped values (ala the EL).
Methods are available to get, set and remove scoped values. You
should use this class in your W-Beans to ensure consistent handling
of scoped values.
- Author:
- Paul Harvey
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCOPE_APPLICATION
public static final String SCOPE_APPLICATION
- See Also:
- Constant Field Values
SCOPE_SERVLET
public static final String SCOPE_SERVLET
- See Also:
- Constant Field Values
SCOPE_SESSION
public static final String SCOPE_SESSION
- See Also:
- Constant Field Values
SCOPE_REQUEST
public static final String SCOPE_REQUEST
- See Also:
- Constant Field Values
SCOPE_BEAN
public static final String SCOPE_BEAN
- See Also:
- Constant Field Values
SCOPE_LOCAL
public static final String SCOPE_LOCAL
- See Also:
- Constant Field Values
ALL_SCOPES
public static final String[] ALL_SCOPES
WeaverAttributeUtil
public WeaverAttributeUtil()
setAttribute
public static void setAttribute(WeaverExecutionContext context,
String paramName,
Object paramValue,
String paramScope)
throws WeaverException
- Set a scoped value.
- Parameters:
context
- The context in which to set the value.paramName
- The name of the value to set.paramValue
- The actual value.paramScope
- The scope in which to set the value - taken from the SCOPE_* strings defined in this class.
- Throws:
WeaverException
- Thrown if the given scope is unknown.
removeAttribute
public static void removeAttribute(WeaverExecutionContext context,
String paramName,
String paramScope)
throws WeaverException
- Remove a scoped value
- Parameters:
context
- The context from which to remove the value.paramName
- The name of the value to remove.paramScope
- The scope to remove the value from (if null the value is removed from all scopes).
- Throws:
WeaverException
- Thrown if the given scope is unknown.
getAttribute
public static Object getAttribute(WeaverExecutionContext context,
String paramName,
String paramScope)
throws WeaverException
- Retrieve a scoped valued.
- Parameters:
context
- The context from which to retrieve the value.paramName
- The name of the value to retrieve.paramScope
- The scope from which to retrieve the value (if null the value is search for
using context.findAttribute).
- Returns:
- The retrieved value - or null if the value is not found.
- Throws:
WeaverException
- Thrown if the given scope is unknown.