public class EvaluationContext extends Object implements IEvaluationContext
Clients may instantiate this default context. The class is not intended to be subclassed by clients.
UNDEFINED_VARIABLE
Constructor and Description |
---|
EvaluationContext(IEvaluationContext parent,
Object defaultVariable)
Create a new evaluation context with the given parent and default
variable.
|
EvaluationContext(IEvaluationContext parent,
Object defaultVariable,
IVariableResolver[] resolvers)
Create a new evaluation context with the given parent and default
variable.
|
Modifier and Type | Method and Description |
---|---|
void |
addVariable(String name,
Object value)
Adds a new named variable to this context.
|
boolean |
getAllowPluginActivation()
Returns whether this evaluation context supports plug-in
activation.
|
Object |
getDefaultVariable()
Returns the default variable.
|
IEvaluationContext |
getParent()
Returns the parent context or
null if
this is the root of the evaluation context hierarchy. |
IEvaluationContext |
getRoot()
Returns the root evaluation context.
|
Object |
getVariable(String name)
Returns the variable managed under the given name.
|
Object |
removeVariable(String name)
Removes the variable managed under the given name
from this evaluation context.
|
Object |
resolveVariable(String name,
Object[] args)
Resolves a variable for the given name and arguments.
|
void |
setAllowPluginActivation(boolean value)
Specifies whether this evaluation context allows activation
of plug-ins for testers used in the expression tree.
|
public EvaluationContext(IEvaluationContext parent, Object defaultVariable)
parent
- the parent context. Can be null
.defaultVariable
- the default variablepublic EvaluationContext(IEvaluationContext parent, Object defaultVariable, IVariableResolver[] resolvers)
parent
- the parent context. Can be null
.defaultVariable
- the default variableresolvers
- an array of IVariableResolvers
to
resolve additional variables.resolveVariable(String, Object[])
public IEvaluationContext getParent()
null
if
this is the root of the evaluation context hierarchy.getParent
in interface IEvaluationContext
null
public IEvaluationContext getRoot()
getRoot
in interface IEvaluationContext
public Object getDefaultVariable()
getDefaultVariable
in interface IEvaluationContext
null
if
no default variable is managed.public void setAllowPluginActivation(boolean value)
true
and the actual test expression must have the
attribute forcePluginActivation
set to
true
as well.setAllowPluginActivation
in interface IEvaluationContext
value
- whether this evaluation context allows plug-in activationpublic boolean getAllowPluginActivation()
IEvaluationContext.setAllowPluginActivation(boolean)
the parent value is returned. If no parent is set false
is returned.getAllowPluginActivation
in interface IEvaluationContext
public void addVariable(String name, Object value)
addVariable
in interface IEvaluationContext
name
- the variable's namevalue
- the variable's valuepublic Object removeVariable(String name)
removeVariable
in interface IEvaluationContext
name
- the variable's namenull
if
the variable doesn't existpublic Object getVariable(String name)
getVariable
in interface IEvaluationContext
name
- the variable's namenull
if the content
doesn't manage a variable with the given namepublic Object resolveVariable(String name, Object[] args) throws CoreException
resolve
expression.resolveVariable
in interface IEvaluationContext
name
- the variable to resolveargs
- an object array of arguments used to resolve the
variablenull
if no variable
can be resolved for the given name and argumentsCoreException
- if an errors occurs while resolving
the variable
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.