@Override public Iterable<? extends MutableAnnotationTypeElementDeclaration> getDeclaredAnnotationTypeElements() { final Function1<JvmMember, MemberDeclaration> _function = (JvmMember it) -> { return this.getCompilationUnit().toMemberDeclaration(it); }; return Iterables.<MutableAnnotationTypeElementDeclaration>filter(ListExtensions.<JvmMember, MemberDeclaration>map(this.getDelegate().getMembers(), _function), MutableAnnotationTypeElementDeclaration.class); } }
@Override public Iterable<? extends AnnotationTypeElementDeclaration> getDeclaredAnnotationTypeElements() { final Function1<JvmMember, MemberDeclaration> _function = (JvmMember it) -> { return this.getCompilationUnit().toMemberDeclaration(it); }; return Iterables.<AnnotationTypeElementDeclaration>filter(ListExtensions.<JvmMember, MemberDeclaration>map(this.getDelegate().getMembers(), _function), AnnotationTypeElementDeclaration.class); } }
@Override public MutableAnnotationTypeElementDeclaration addAnnotationTypeElement(final String name, final Procedure1<MutableAnnotationTypeElementDeclaration> initializer) { this.checkMutable(); ConditionUtils.checkJavaIdentifier(name, "name"); Preconditions.checkArgument((initializer != null), "initializer cannot be null"); final JvmOperation newAnnotationElement = TypesFactory.eINSTANCE.createJvmOperation(); newAnnotationElement.setSimpleName(name); newAnnotationElement.setVisibility(JvmVisibility.PUBLIC); this.getDelegate().getMembers().add(newAnnotationElement); MemberDeclaration _memberDeclaration = this.getCompilationUnit().toMemberDeclaration(newAnnotationElement); final MutableAnnotationTypeElementDeclaration mutableAnnotationTypeElementDeclaration = ((MutableAnnotationTypeElementDeclaration) _memberDeclaration); initializer.apply(mutableAnnotationTypeElementDeclaration); return mutableAnnotationTypeElementDeclaration; }
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); }
translateAnnotationsTo(member.getAnnotations(), operation); jvmTypesBuilder.copyDocumentationTo(member, operation); inferredJvmType.getMembers().add(operation);