Package org.eclipse.core.expressions
Class ReferenceExpression
- java.lang.Object
-
- org.eclipse.core.expressions.Expression
-
- org.eclipse.core.expressions.ReferenceExpression
-
public class ReferenceExpression extends Expression
This class makes use of the org.eclipse.core.expressions.definitions extension point to evaluate the current context against pre-defined expressions. It provides core expression re-use.- Since:
- 3.7
-
-
Field Summary
-
Fields inherited from class org.eclipse.core.expressions.Expression
ATT_VALUE, FALSE, HASH_CODE_NOT_COMPUTED, HASH_FACTOR, TRUE
-
-
Constructor Summary
Constructors Constructor Description ReferenceExpression(String definitionId)ReferenceExpression(IConfigurationElement element)ReferenceExpression(Element element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectExpressionInfo(ExpressionInfo info)Collects information about this expression tree.protected intcomputeHashCode()Method to compute the hash code for this object.booleanequals(Object object)EvaluationResultevaluate(IEvaluationContext context)Evaluates this expression.StringtoString()-
Methods inherited from class org.eclipse.core.expressions.Expression
computeExpressionInfo, equals, equals, hashCode, hashCode, hashCode
-
-
-
-
Constructor Detail
-
ReferenceExpression
public ReferenceExpression(String definitionId)
-
ReferenceExpression
public ReferenceExpression(IConfigurationElement element) throws CoreException
- Throws:
CoreException
-
ReferenceExpression
public ReferenceExpression(Element element) throws CoreException
- Throws:
CoreException
-
-
Method Detail
-
evaluate
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException
Description copied from class:ExpressionEvaluates this expression.- Specified by:
evaluatein classExpression- 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
-
collectExpressionInfo
public void collectExpressionInfo(ExpressionInfo info)
Description copied from class:ExpressionCollects information about this expression tree. This default implementation add the expression's type to the set of misbehaving expression types.- Overrides:
collectExpressionInfoin classExpression- Parameters:
info- the expression information object used to collect the information
-
computeHashCode
protected int computeHashCode()
Description copied from class:ExpressionMethod to compute the hash code for this object. The result returned from this method in cached in thefHashCodefield. If the value returned from the method equalsExpression.HASH_CODE_NOT_COMPUTED(e.g.-1) then the value is incremented by one.This default implementation calls
super.hashCode()- Overrides:
computeHashCodein classExpression- Returns:
- a hash code for this object.
-
-