net.sourceforge.stripes.util
Class OgnlCustomNullHandler

java.lang.Object
  extended by ognl.ObjectNullHandler
      extended by 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

Field Summary
protected static String INSTANTIATE_LEAF_NODES
           
protected static Map<Class,Class> interfaceImplementations
           
 
Constructor Summary
OgnlCustomNullHandler()
           
 
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 ognl.ObjectNullHandler
nullMethodResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANTIATE_LEAF_NODES

protected static final String INSTANTIATE_LEAF_NODES
See Also:
Constant Field Values

interfaceImplementations

protected static final Map<Class,Class> interfaceImplementations
Constructor Detail

OgnlCustomNullHandler

public OgnlCustomNullHandler()
Method Detail

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:

Specified by:
nullPropertyValue in interface NullHandler
Overrides:
nullPropertyValue in class ObjectNullHandler
Parameters:
context - the OgnlContext, actually of type OgnlContext
target - the object on which the null property was found
property - 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.