/** * compares two annotated elements to see if they have the same annotations * * @param a1 * @param a2 * @return */ private static boolean compareAnnotated(Annotated a1, Annotated a2) { return a1.getAnnotations().equals(a2.getAnnotations()); }
/** * Compares two annotated elements to see if they have the same annotations */ private static boolean compareAnnotated(Annotated a1, Annotated a2) { return a1.getAnnotations().equals(a2.getAnnotations()); }
/** * compares two annotated elements to see if they have the same annotations * * @param a1 * @param a2 * @return */ private static boolean compareAnnotated(Annotated a1, Annotated a2) { return a1.getAnnotations().equals(a2.getAnnotations()); }
/** * * @param annotated */ AnnotatedConfigurator(A annotated) { this.annotated = annotated; this.annotations = new HashSet<>(annotated.getAnnotations()); }
/** * * @param annotated */ AnnotatedConfigurator(A annotated) { this.annotated = annotated; this.annotations = new HashSet<>(annotated.getAnnotations()); }
/** * * @param annotated */ AnnotatedConfigurator(A annotated) { this.annotated = annotated; this.annotations = new HashSet<>(annotated.getAnnotations()); }
/** * * @param annotated */ AnnotatedConfigurator(A annotated) { this.annotated = annotated; this.annotations = new HashSet<>(annotated.getAnnotations()); }
@Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<>(this.annotations); annotations.addAll(decorated.getAnnotations()); return Collections.unmodifiableSet(annotations); }
@Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<>(this.annotations); annotations.addAll(decorated.getAnnotations()); return Collections.unmodifiableSet(annotations); }
public AnnotatedWrapper(Annotated delegate, boolean keepOriginalAnnotations, Annotation... annotations) { this.delegate = delegate; this.annotations = new HashSet<Annotation>(Arrays.asList(annotations)); if (keepOriginalAnnotations) { this.annotations.addAll(delegate.getAnnotations()); } }
private boolean hasExcludeAnnotation(Annotated annotated, Pattern excludeAnnotation) { for (Annotation annotation : annotated.getAnnotations()) { if (excludeAnnotation.matcher(annotation.annotationType().getName()).matches()) { return true; } } return false; }
@Override public <T extends Annotation> Set<T> getAnnotations(Class<T> aClass) { Set<T> annotations = new HashSet<>(decorated.getAnnotations(aClass)); T annotation = getDecoratingAnnotation(aClass); if (annotation != null) { annotations.add(annotation); } return Collections.unmodifiableSet(annotations); }
@SuppressWarnings("unchecked") public Set<Annotation> getQualifiers(BeanManager beanManager, GenericIdentifier identifier, Iterable<Annotation> annotations) { return Beans.getQualifiers(beanManager, genericConfigurationPoints.get(identifier).getAnnotated().getAnnotations(), annotations); }
private void validateStatelessSessionBean(Annotated type) { assert type.getBaseType().equals(Sheep.class); assert rawTypeSetMatches(type.getTypeClosure(), Sheep.class, SheepLocal.class, Object.class); assert type.getAnnotations().size() == 2; assert annotationSetMatches(type.getAnnotations(), Tame.class, Stateless.class); // TODO // Check }
protected void mergeAnnotationsOnElement(Annotated annotated, boolean overwriteExisting, AnnotationBuilder typeAnnotations) { for (Annotation annotation : annotated.getAnnotations()) { if (typeAnnotations.getAnnotation(annotation.annotationType()) != null) { if (overwriteExisting) { typeAnnotations.remove(annotation.annotationType()); typeAnnotations.add(annotation); } } else { typeAnnotations.add(annotation); } } }
protected DefaultMethodHandler(final MicroserviceProxyBean proxyBean, final InjectionPoint injectionPoint) throws Exception { this.proxyBean = proxyBean; this.injectionPoint = injectionPoint; final Set<Annotation> qualifiers = proxyBean.getQualifiers().stream() .filter(qualifier -> !matches(qualifier, MicroserviceReference.class)) .collect(Collectors.toSet()); final MicroserviceMetaData metaData = VersionResolver.getInstance() .createMicroserviceMetadataForInjectionPoint(proxyBean.getMicroserviceName(), proxyBean.getServiceInterface(), qualifiers, injectionPoint.getAnnotated().getAnnotations()); this.lookupStrategy = LookupStrategyFactory.getStrategy(proxyBean.getContext(), metaData, injectionPoint.getAnnotated().getAnnotations()); }
public static void validateAnnotated(Annotated annotated) { checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated); checkNotNull(annotated.getBaseType(), "getBaseType()", annotated); checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated); }
public static void validateAnnotated(Annotated annotated) { checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated); checkNotNull(annotated.getBaseType(), "getBaseType()", annotated); checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated); }
public static void validateAnnotated(Annotated annotated) { checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated); checkNotNull(annotated.getBaseType(), "getBaseType()", annotated); checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated); }
public static void validateAnnotated(Annotated annotated) { checkNotNull(annotated.getAnnotations(), "getAnnotations()", annotated); checkNotNull(annotated.getBaseType(), "getBaseType()", annotated); checkNotNull(annotated.getTypeClosure(), "getTypeClosure()", annotated); }