33 |
public ConstantExpression evaluate(Context context) |
public ConstantExpression evaluate(Context context) |
34 |
throws IllegalExpressionException |
throws IllegalExpressionException |
35 |
{ |
{ |
36 |
Object value = context.getEvaluatorEnvironment().getValue(identifier); |
Object value = context.getEvaluatorEnvironment().getValue(identifier, context.getVisitedFields()); |
37 |
|
|
38 |
if (value instanceof Byte) { |
if (value instanceof Byte) { |
39 |
return new ConstantByte(((Byte)value).byteValue()); |
return new ConstantByte(((Byte)value).byteValue()); |
62 |
else if (value instanceof String) { |
else if (value instanceof String) { |
63 |
return new ConstantString((String)value); |
return new ConstantString((String)value); |
64 |
} |
} |
65 |
|
else if (null != value) { |
66 |
|
throw new IllegalExpressionException("Unsupported type " + value.getClass().getName() + " for identifier " + identifier); |
67 |
|
} |
68 |
else { |
else { |
69 |
throw new IllegalExpressionException("Unsupported type for identifier " + identifier); |
throw new IllegalExpressionException("Cannot resolve identifier " + identifier); |
70 |
} |
} |
71 |
} |
} |
72 |
} |
} |