net.sourceforge.stripes.util
Class OgnlCustomNullHandler
java.lang.Object
ognl.ObjectNullHandler
net.sourceforge.stripes.util.OgnlCustomNullHandler
- All Implemented Interfaces:
- NullHandler
public class OgnlCustomNullHandler
- extends ObjectNullHandler
NullHandler implementation used to replace the default one that ships with Ognl. During setValue
operations it will ensure that the object graph is fully formed so that the target property can
be set. During get operations it will create intermediary objects as necessary, but not add
them to the object graph. This allows callers to discover information about the object graph
during get operations without mutating the object graph.
- Author:
- Tim Fennell
|
Method Summary |
Object |
nullPropertyValue(Map context,
Object target,
Object property)
Figures out what to do when Ognl encounters a null value in one of the expressions that it
is evaluating. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANTIATE_LEAF_NODES
protected static final String INSTANTIATE_LEAF_NODES
- See Also:
- Constant Field Values
interfaceImplementations
protected static final Map<Class,Class> interfaceImplementations
OgnlCustomNullHandler
public OgnlCustomNullHandler()
nullPropertyValue
public Object nullPropertyValue(Map context,
Object target,
Object property)
- Figures out what to do when Ognl encounters a null value in one of the expressions that it
is evaluating. The rules followed are as follows:
- If the expression is being evaluated to set an value, the null intermediate object is
instantiated and set on its parent object.
- If the expression is a get expression and the null value is an intermediary value then
the intermediary is temporarily instantiated but the object is never set on
it's parent object
- If the expression is a get expression and the null value is the result of the final
node in the expression, null is returned.
- Specified by:
nullPropertyValue in interface NullHandler- Overrides:
nullPropertyValue in class ObjectNullHandler
- Parameters:
context - the OgnlContext, actually of type OgnlContexttarget - the object on which the null property was foundproperty - really a String, the name of the property being retrieved
- Returns:
- the swapped in value if one was created otherwise null
© Copyright 2005, Stripes Development Team.