val JvmAnnotationReference result = typesFactory.createJvmAnnotationReference(); val JvmType jvmType = references.findDeclaredType(annotationTypeName, context); if (jvmType == null) {
protected JvmAnnotationReference createJvmAnnotationReference(final JvmType type) { JvmAnnotationReference _switchResult = null; boolean _matched = false; if (type instanceof JvmAnnotationType) { _matched=true; JvmAnnotationReference _createJvmAnnotationReference = TypesFactory.eINSTANCE.createJvmAnnotationReference(); final Procedure1<JvmAnnotationReference> _function = (JvmAnnotationReference it) -> { it.setAnnotation(((JvmAnnotationType)type)); }; _switchResult = ObjectExtensions.<JvmAnnotationReference>operator_doubleArrow(_createJvmAnnotationReference, _function); } if (!_matched) { _switchResult = null; } return _switchResult; } }
public JvmAnnotationReference findOrAddAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ Notifier context, /* @NonNull */ Class<? extends Annotation> type) { JvmAnnotationReference result = findAnnotation(annotationTarget, type); if (result != null) return result; JvmAnnotationType annotationType = findAnnotationType(type, context); if (annotationType != null) { result = typesFactory.createJvmAnnotationReference(); result.setAnnotation(annotationType); return result; } return null; }
JvmAnnotationReference result = typesFactory.createJvmAnnotationReference(); JvmType jvmType = references.findDeclaredType(annotationTypeName, sourceElement); if (jvmType == null) {
public JvmAnnotationReferenceBuilder(InternalEList<JvmAnnotationReference> target, String desc, Proxies proxies) { super(Opcodes.ASM7); this.proxies = proxies; this.target = target; this.annotationType = BinarySignatures.createTypeSignature(desc); result = TypesFactory.eINSTANCE.createJvmAnnotationReference(); result.setAnnotation(proxies.createAnnotationProxy(annotationType)); values = (InternalEList<JvmAnnotationValue>) result.getExplicitValues(); }
if (context == null || annotationTypeName == null) return null; JvmAnnotationReference result = typesFactory.createJvmAnnotationReference(); JvmType jvmType = references.findDeclaredType(annotationTypeName, context); if (jvmType == null) {
@Nullable public JvmAnnotationReference findOrAddAnnotation(@NonNull JvmAnnotationTarget annotationTarget, @NonNull Notifier context, @NonNull Class<? extends Annotation> type) { JvmAnnotationReference result = findAnnotation(annotationTarget, type); if (result != null) return result; JvmAnnotationType annotationType = findAnnotationType(type, context); if (annotationType != null) { result = typesFactory.createJvmAnnotationReference(); result.setAnnotation(annotationType); return result; } return null; }
protected JvmAnnotationReference createAnnotationReference(Annotation annotation) { JvmAnnotationReference annotationReference = TypesFactory.eINSTANCE.createJvmAnnotationReference(); Class<? extends Annotation> type = annotation.annotationType(); annotationReference.setAnnotation(createAnnotationProxy(type)); Method[] declaredMethods = type.getDeclaredMethods(); if (declaredMethods.length > 0) { InternalEList<JvmAnnotationValue> values = (InternalEList<JvmAnnotationValue>)annotationReference.getValues(); for (Method method : declaredMethods) { try { Object value = method.invoke(annotation, EMPTY_ARRAY); Class<?> returnType = method.getReturnType(); if (returnType.isArray()) { JvmAnnotationValue annotationValue = createArrayAnnotationValue(value, returnType); values.addUnique(annotationValue); annotationValue.setOperation(createMethodProxy(method)); } else { JvmAnnotationValue annotationValue = createAnnotationValue(value, returnType); values.addUnique(annotationValue); annotationValue.setOperation(createMethodProxy(method)); } } catch (Exception e) { log.error(e.getMessage(), e); } } } return annotationReference; }
protected JvmAnnotationReference createAnnotationReference(Annotation annotation) { JvmAnnotationReference annotationReference = TypesFactory.eINSTANCE.createJvmAnnotationReference(); Class<? extends Annotation> type = annotation.annotationType(); annotationReference.setAnnotation(createAnnotationProxy(type)); Method[] declaredMethods = type.getDeclaredMethods(); if (declaredMethods.length > 0) { InternalEList<JvmAnnotationValue> values = (InternalEList<JvmAnnotationValue>)annotationReference.getExplicitValues(); for (Method method : declaredMethods) { try { Object value = method.invoke(annotation, EMPTY_ARRAY); Class<?> returnType = method.getReturnType(); if (returnType.isArray()) { JvmAnnotationValue annotationValue = createArrayAnnotationValue(value, returnType); values.addUnique(annotationValue); annotationValue.setOperation(createMethodProxy(method)); } else { JvmAnnotationValue annotationValue = createAnnotationValue(value, returnType); values.addUnique(annotationValue); annotationValue.setOperation(createMethodProxy(method)); } } catch (Exception e) { log.error(e.getMessage(), e); } } } return annotationReference; }
assert annotationType != null; try { final JvmAnnotationReference result = this.typesFactory.createJvmAnnotationReference(); final JvmType jvmType = this.typeReferences.findDeclaredType(annotationType, target); if (jvmType == null) {
if(anno == null) return null; JvmAnnotationReference reference = typesFactory.createJvmAnnotationReference(); final JvmType annotation = (JvmType) anno.eGet( XAnnotationsPackage.Literals.XANNOTATION__ANNOTATION_TYPE, false);
final Procedure1<AnnotationReferenceBuildContextImpl> _function = (AnnotationReferenceBuildContextImpl it) -> { it.setCompilationUnit(this); JvmAnnotationReference _createJvmAnnotationReference = this.typesFactory.createJvmAnnotationReference(); final Procedure1<JvmAnnotationReference> _function_1 = (JvmAnnotationReference reference) -> { JvmType _annotationType = annotation.getAnnotationType();