Eclipse Platform
Release 3.2

org.eclipse.core.expressions
Class Expression

java.lang.Object
  extended byorg.eclipse.core.expressions.Expression
Direct Known Subclasses:
ActiveShellExpression, LegacyHandlerSubmissionExpression

public abstract class Expression
extends Object

Abstract base class for all expressions provided by the common expression language.

An expression is evaluated by calling evaluate(IEvaluationContext).

This class may be subclassed to provide specific expressions.

Since:
3.0

Field Summary
protected static String ATT_VALUE
          Name of the value attribute of an expression (value is value).
static Expression FALSE
          The expression corresponding to EvaluationResult.FALSE.
static Expression TRUE
          The expression corresponding to EvaluationResult.TRUE.
 
Constructor Summary
Expression()
           
 
Method Summary
 void collectExpressionInfo(ExpressionInfo info)
          Collects information about this expression tree.
 ExpressionInfo computeExpressionInfo()
          Computes the expression information for the given expression tree.
abstract  EvaluationResult evaluate(IEvaluationContext context)
          Evaluates this expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_VALUE

protected static final String ATT_VALUE
Name of the value attribute of an expression (value is value).

See Also:
Constant Field Values

TRUE

public static final Expression TRUE
The expression corresponding to EvaluationResult.TRUE.


FALSE

public static final Expression FALSE
The expression corresponding to EvaluationResult.FALSE.

Constructor Detail

Expression

public Expression()
Method Detail

evaluate

public abstract EvaluationResult evaluate(IEvaluationContext context)
                                   throws CoreException
Evaluates this expression.

Parameters:
context - an evaluation context providing information like variable, name spaces, etc. necessary to evaluate this expression
Returns:
the result of the expression evaluation
Throws:
CoreException - if the evaluation failed. The concrete reason is defined by the subclass implementing this method

computeExpressionInfo

public final ExpressionInfo computeExpressionInfo()
Computes the expression information for the given expression tree.

This is a convenience method for collecting the expression information using collectExpressionInfo(ExpressionInfo).

Returns:
the expression information
Since:
3.2

collectExpressionInfo

public void collectExpressionInfo(ExpressionInfo info)
Collects information about this expression tree. This default implementation add the expression's type to the set of misbehaving expression types.

Parameters:
info - the expression information object used to collect the information
Since:
3.2

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.