protected Object translateAnnotationValue(final XExpression value, final String property) { final JvmType annotationType = this.getDelegate().getAnnotationType(); if ((annotationType instanceof JvmAnnotationType)) { final Function1<JvmOperation, Boolean> _function = (JvmOperation it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, property)); }; final JvmOperation operation = IterableExtensions.<JvmOperation>findFirst(Iterables.<JvmOperation>filter(((JvmAnnotationType)annotationType).getMembers(), JvmOperation.class), _function); if ((operation != null)) { final boolean array = this.getCompilationUnit().getTypeReferences().isArray(operation.getReturnType()); return this.getCompilationUnit().translateAnnotationValue(value, operation.getReturnType(), array); } } return this.getCompilationUnit().translateAnnotationValue(value, null, false); }
@Override public Object getDefaultValue() { return this.getCompilationUnit().translateAnnotationValue(this.getDelegate().getDefaultValue(), this.getCompilationUnit().getTypeReferences().isArray(this.getDelegate().getReturnType())); }
@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; }