use of org.eclipse.xtext.xbase.interpreter.ConstantExpressionEvaluationException in project xtext-xtend by eclipse.
the class JvmAnnotationReferenceImpl method getValue.
@Override
public Object getValue(final String property) {
try {
final JvmOperation op = this.findOperation(property);
final Function1<JvmAnnotationValue, Boolean> _function = (JvmAnnotationValue it) -> {
return Boolean.valueOf((Objects.equal(it.getOperation(), op) || ((it.getOperation() == null) && Objects.equal(op.getSimpleName(), "value"))));
};
final JvmAnnotationValue annotationValue = IterableExtensions.<JvmAnnotationValue>findFirst(this.getDelegate().getValues(), _function);
final boolean isArrayType = ((op != null) && this.getCompilationUnit().getTypeReferences().isArray(op.getReturnType()));
if ((annotationValue != null)) {
return this.getCompilationUnit().translateAnnotationValue(annotationValue, isArrayType);
}
} catch (final Throwable _t) {
if (_t instanceof ConstantExpressionEvaluationException) {
final ConstantExpressionEvaluationException e = (ConstantExpressionEvaluationException) _t;
this.getCompilationUnit().getProblemSupport().addError(this, e.getMessage());
} else {
throw Exceptions.sneakyThrow(_t);
}
}
return null;
}
Aggregations