public static boolean isDeprecated(JvmAnnotationType jvmAnnotationType) { return jvmAnnotationType.getQualifiedName().equals(Deprecated.class.getName()); } }
@Override public Boolean apply(final JvmAnnotationReference it) { JvmAnnotationType _annotation = it.getAnnotation(); String _qualifiedName = _annotation.getQualifiedName(); String _name = Pure.class.getName(); return Boolean.valueOf(Objects.equal(_qualifiedName, _name)); } };
public static boolean hasPureAnnotation(JvmOperation jvmOperation) { return jvmOperation.getAnnotations().stream() .anyMatch(ref -> Objects.equals(ref.getAnnotation().getQualifiedName(), Pure.class.getName())); } }
protected JvmAnnotationReference findAnnotation(JvmAnnotationTarget feature, String annotationType) { if (feature == null) return null; if (annotationType == null) throw new NullPointerException(); List<JvmAnnotationReference> annotations = feature.getAnnotations(); for (JvmAnnotationReference annotation : annotations) { if (annotationType.equals(annotation.getAnnotation().getQualifiedName())) { return annotation; } } return null; }
/** * @return {@code true} if the operation is annotated with {@code org.testeditor.fixture.core.interaction.FixtureMethod}. */ private boolean hasFixtureMethodAnnotation(final JvmOperation operation) { final Function1<JvmAnnotationReference, Boolean> _function = (JvmAnnotationReference it) -> { String _qualifiedName = it.getAnnotation().getQualifiedName(); return Boolean.valueOf(Objects.equal(_qualifiedName, "org.testeditor.fixture.core.interaction.FixtureMethod")); }; return IterableExtensions.<JvmAnnotationReference>exists(operation.getAnnotations(), _function); } }
public JvmAnnotationReference findAnnotation(/* @NonNull */ JvmAnnotationTarget annotationTarget, /* @NonNull */ Class<? extends Annotation> lookupType) { // avoid creating an empty list for all given targets but check for #eIsSet first if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) { for(JvmAnnotationReference annotation: annotationTarget.getAnnotations()) { JvmAnnotationType annotationType = annotation.getAnnotation(); if (annotationType != null && lookupType.getCanonicalName().equals(annotationType.getQualifiedName())) { return annotation; } } } return null; }
@Nullable public JvmAnnotationReference findAnnotation(@NonNull JvmAnnotationTarget annotationTarget, @NonNull Class<? extends Annotation> lookupType) { // avoid creating an empty list for all given targets but check for #eIsSet first if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) { for(JvmAnnotationReference annotation: annotationTarget.getAnnotations()) { JvmAnnotationType annotationType = annotation.getAnnotation(); if (annotationType != null && lookupType.getCanonicalName().equals(annotationType.getQualifiedName())) { return annotation; } } } return null; }
/** Find an annotation. * * @param annotationTarget the annotation target. * @param lookupType the name of the type to look for. * @return the annotation or {@code null}. * @see AnnotationLookup#findAnnotation(JvmAnnotationTarget, Class) */ @SuppressWarnings("static-method") public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) { // avoid creating an empty list for all given targets but check for #eIsSet first if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) { for (final JvmAnnotationReference annotation: annotationTarget.getAnnotations()) { final JvmAnnotationType annotationType = annotation.getAnnotation(); if (annotationType != null && Objects.equals(lookupType, annotationType.getQualifiedName())) { return annotation; } } } return null; }
String _qualifiedName = it.getAnnotation().getQualifiedName(); String _name = AggregatorType.class.getName(); return Boolean.valueOf(Objects.equal(_qualifiedName, _name));
if (this.annotationUtils.findAnnotation(newParam, annotationReference.getAnnotation().getQualifiedName()) == null) { final JvmAnnotationReference annotation = EcoreUtil.copy(annotationReference); if (annotation != null) { if (this.annotationUtils.findAnnotation(newCons, annotationReference.getAnnotation().getQualifiedName()) == null) { final JvmAnnotationReference annotation = EcoreUtil.copy(annotationReference); if (annotation != null) {