ariba.util.expr
Class ExprContext

java.lang.Object
  extended by ariba.util.expr.ExprContext
All Implemented Interfaces:
java.util.Map

public class ExprContext
extends java.lang.Object
implements java.util.Map

This class defines the execution context for an AribaExpr expression

Author:
Luke Blanshard (blanshlu@netscape.net), Drew Davidson (drew@ognl.org)

Nested Class Summary
static interface ExprContext.ExtensibleContext
           
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static java.lang.String CLASS_RESOLVER_CONTEXT_KEY
           
static java.lang.String CONTEXT_CONTEXT_KEY
           
static java.lang.String CURRENT_METHODINFO_IN_EXECUTION
          Key for methodInfo being passed in the Map
static ClassResolver DEFAULT_CLASS_RESOLVER
           
static MemberAccess DEFAULT_MEMBER_ACCESS
           
static TypeConverter DEFAULT_TYPE_CONVERTER
           
static java.lang.String KEEP_LAST_EVALUATION_CONTEXT_KEY
           
static java.lang.String LAST_EVALUATION_CONTEXT_KEY
           
static java.lang.String LOGIN_USER_CONTEXT_KEY
           
static java.lang.String MEMBER_ACCESS_CONTEXT_KEY
           
static java.lang.String ROOT_CONTEXT_KEY
           
static java.lang.String THIS_CONTEXT_KEY
           
static java.lang.String TRACE_EVALUATIONS_CONTEXT_KEY
           
static java.lang.String TYPE_CONVERTER_CONTEXT_KEY
           
 
Constructor Summary
ExprContext()
          Constructs a new ExprContext with the default class resolver, type converter and member access.
ExprContext(ClassResolver classResolver, TypeConverter typeConverter, MemberAccess memberAccess)
          Constructs a new ExprContext with the given class resolver, type converter and member access.
ExprContext(ClassResolver classResolver, TypeConverter typeConverter, MemberAccess memberAccess, java.util.Map values)
           
ExprContext(java.util.Map values)
           
ExprContext(SymbolTable symbolTable)
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.Object key)
           
 ClassResolver getClassResolver()
           
 Evaluation getCurrentEvaluation()
          Gets the current Evaluation from the top of the stack.
 Node getCurrentNode()
           
 java.lang.Object getCurrentObject()
           
 Evaluation getEvaluation(int relativeIndex)
          Returns the Evaluation at the relative index given.
static ExprContext.ExtensibleContext getExtensibleContext()
           
 boolean getKeepLastEvaluation()
          Returns true if the last evaluation that was done on this context is retained and available through getLastEvaluation().
 Evaluation getLastEvaluation()
           
static java.lang.Object getLoginUser()
           
static java.lang.String getLoginUserTypeName()
           
 MemberAccess getMemberAccess()
           
 java.lang.Object getRoot()
           
 Evaluation getRootEvaluation()
          Gets the root of the evaluation stack.
 java.lang.Integer getSymbolKind(Symbol symbol)
           
 SymbolTable getSymbolTable()
           
 TypeInfo getSymbolType(Symbol symbol)
           
 boolean getTraceEvaluations()
           
 TypeConverter getTypeConverter()
           
 java.util.Map getValues()
           
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 Evaluation popEvaluation()
          Pops the current Evaluation off of the top of the stack.
 void pushEvaluation(Evaluation value)
          Pushes a new Evaluation onto the stack.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map t)
           
 void recycleLastEvaluation()
          This method can be called when the last evaluation has been used and can be returned for reuse in the free pool maintained by the runtime.
 java.lang.Object remove(java.lang.Object key)
           
 void setClassResolver(ClassResolver value)
           
 void setCurrentEvaluation(Evaluation value)
           
 void setCurrentNode(Node value)
           
 void setCurrentObject(java.lang.Object value)
           
static void setExtensibleContext(ExprContext.ExtensibleContext context)
           
 void setKeepLastEvaluation(boolean value)
          Sets whether the last evaluation that was done on this context is retained and available through getLastEvaluation().
 void setLastEvaluation(Evaluation value)
           
 void setMemberAccess(MemberAccess value)
           
 void setRoot(java.lang.Object value)
           
 void setRootEvaluation(Evaluation value)
           
 void setTraceEvaluations(boolean value)
           
 void setTypeConverter(TypeConverter value)
           
 void setValues(java.util.Map value)
           
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_CONTEXT_KEY

public static final java.lang.String CONTEXT_CONTEXT_KEY
See Also:
Constant Field Values

ROOT_CONTEXT_KEY

public static final java.lang.String ROOT_CONTEXT_KEY
See Also:
Constant Field Values

THIS_CONTEXT_KEY

public static final java.lang.String THIS_CONTEXT_KEY
See Also:
Constant Field Values

LOGIN_USER_CONTEXT_KEY

public static final java.lang.String LOGIN_USER_CONTEXT_KEY
See Also:
Constant Field Values

TRACE_EVALUATIONS_CONTEXT_KEY

public static final java.lang.String TRACE_EVALUATIONS_CONTEXT_KEY
See Also:
Constant Field Values

LAST_EVALUATION_CONTEXT_KEY

public static final java.lang.String LAST_EVALUATION_CONTEXT_KEY
See Also:
Constant Field Values

KEEP_LAST_EVALUATION_CONTEXT_KEY

public static final java.lang.String KEEP_LAST_EVALUATION_CONTEXT_KEY
See Also:
Constant Field Values

CLASS_RESOLVER_CONTEXT_KEY

public static final java.lang.String CLASS_RESOLVER_CONTEXT_KEY
See Also:
Constant Field Values

TYPE_CONVERTER_CONTEXT_KEY

public static final java.lang.String TYPE_CONVERTER_CONTEXT_KEY
See Also:
Constant Field Values

MEMBER_ACCESS_CONTEXT_KEY

public static final java.lang.String MEMBER_ACCESS_CONTEXT_KEY
See Also:
Constant Field Values

DEFAULT_CLASS_RESOLVER

public static final ClassResolver DEFAULT_CLASS_RESOLVER

DEFAULT_TYPE_CONVERTER

public static final TypeConverter DEFAULT_TYPE_CONVERTER

DEFAULT_MEMBER_ACCESS

public static final MemberAccess DEFAULT_MEMBER_ACCESS

CURRENT_METHODINFO_IN_EXECUTION

public static final java.lang.String CURRENT_METHODINFO_IN_EXECUTION
Key for methodInfo being passed in the Map

See Also:
Constant Field Values
Constructor Detail

ExprContext

public ExprContext()
Constructs a new ExprContext with the default class resolver, type converter and member access.


ExprContext

public ExprContext(ClassResolver classResolver,
                   TypeConverter typeConverter,
                   MemberAccess memberAccess)
Constructs a new ExprContext with the given class resolver, type converter and member access. If any of these parameters is null the default will be used.


ExprContext

public ExprContext(java.util.Map values)

ExprContext

public ExprContext(ClassResolver classResolver,
                   TypeConverter typeConverter,
                   MemberAccess memberAccess,
                   java.util.Map values)

ExprContext

public ExprContext(SymbolTable symbolTable)
Method Detail

getExtensibleContext

public static ExprContext.ExtensibleContext getExtensibleContext()

setExtensibleContext

public static void setExtensibleContext(ExprContext.ExtensibleContext context)

setValues

public void setValues(java.util.Map value)

getValues

public java.util.Map getValues()

setClassResolver

public void setClassResolver(ClassResolver value)

getClassResolver

public ClassResolver getClassResolver()

setTypeConverter

public void setTypeConverter(TypeConverter value)

getTypeConverter

public TypeConverter getTypeConverter()

setMemberAccess

public void setMemberAccess(MemberAccess value)

getMemberAccess

public MemberAccess getMemberAccess()

getSymbolTable

public SymbolTable getSymbolTable()

setRoot

public void setRoot(java.lang.Object value)

getRoot

public java.lang.Object getRoot()

getTraceEvaluations

public boolean getTraceEvaluations()

setTraceEvaluations

public void setTraceEvaluations(boolean value)

getLastEvaluation

public Evaluation getLastEvaluation()

setLastEvaluation

public void setLastEvaluation(Evaluation value)

recycleLastEvaluation

public void recycleLastEvaluation()
This method can be called when the last evaluation has been used and can be returned for reuse in the free pool maintained by the runtime. This is not a necessary step, but is useful for keeping memory usage down. This will recycle the last evaluation and then set the last evaluation to null.


getKeepLastEvaluation

public boolean getKeepLastEvaluation()
Returns true if the last evaluation that was done on this context is retained and available through getLastEvaluation(). The default is true.


setKeepLastEvaluation

public void setKeepLastEvaluation(boolean value)
Sets whether the last evaluation that was done on this context is retained and available through getLastEvaluation(). The default is true.


setCurrentObject

public void setCurrentObject(java.lang.Object value)

getCurrentObject

public java.lang.Object getCurrentObject()

setCurrentNode

public void setCurrentNode(Node value)

getCurrentNode

public Node getCurrentNode()

getCurrentEvaluation

public Evaluation getCurrentEvaluation()
Gets the current Evaluation from the top of the stack. This is the Evaluation that is in process of evaluating.


setCurrentEvaluation

public void setCurrentEvaluation(Evaluation value)

getRootEvaluation

public Evaluation getRootEvaluation()
Gets the root of the evaluation stack. This Evaluation contains the node representing the root expression and the source is the root source object.


setRootEvaluation

public void setRootEvaluation(Evaluation value)

getEvaluation

public Evaluation getEvaluation(int relativeIndex)
Returns the Evaluation at the relative index given. This should be zero or a negative number as a relative reference back up the evaluation stack. Therefore getEvaluation(0) returns the current Evaluation.


pushEvaluation

public void pushEvaluation(Evaluation value)
Pushes a new Evaluation onto the stack. This is done before a node evaluates. When evaluation is complete it should be popped from the stack via popEvaluation().


popEvaluation

public Evaluation popEvaluation()
Pops the current Evaluation off of the top of the stack. This is done after a node has completed its evaluation.


size

public int size()
Specified by:
size in interface java.util.Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map

clear

public void clear()
Specified by:
clear in interface java.util.Map

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.lang.Object

getSymbolKind

public java.lang.Integer getSymbolKind(Symbol symbol)

getSymbolType

public TypeInfo getSymbolType(Symbol symbol)

getLoginUserTypeName

public static java.lang.String getLoginUserTypeName()

getLoginUser

public static java.lang.Object getLoginUser()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.