protected <A extends Annotation> void redefineAnnotationBuilder(Class<A> annotationType, AnnotationRedefiner<A> redefinition, AnnotatedElement annotated, Type baseType, AnnotationBuilder builder, String elementName) { if (builder.isAnnotationPresent(annotationType)) { redefinition.redefine(new RedefinitionContext<A>(annotated, baseType, builder, elementName)); } }
public void redefine(RedefinitionContext<Produces> ctx) { // Add the marker qualifier ctx.getAnnotationBuilder().add(GenericMarkerLiteral.INSTANCE).add(genericBeanQualifier); }
public AnnotationBuilder addAll(AnnotationStore annotations) { for (Annotation annotation : annotations.getAnnotations()) { add(annotation); } return this; }
private <X> AnnotatedTypeBuilder<X> initializeBuilder(final AnnotatedTypeBuilder<X> currentBuilder, final AnnotatedType<X> source) { if (currentBuilder == null) { return new AnnotatedTypeBuilder<X>().readFromType(source); } return currentBuilder; }
/** * Reads in from an existing AnnotatedType. Any elements not present are * added. The javaClass will be read in. If the annotation already exists on * that element in the builder the read annotation will be used. * * @param type the type to read from * @throws IllegalArgumentException if type is null */ public AnnotatedTypeBuilder<X> readFromType(AnnotatedType<X> type) { return readFromType(type, true); }
public void redefine(RedefinitionContext<Inject> ctx) { if (ctx.getAnnotatedElement() instanceof Field) { if (ctx.getAnnotatedElement().isAnnotationPresent(Generic.class)) { // This is a Generic bean injection point ctx.getAnnotationBuilder().remove(Inject.class).add(InjectGenericLiteral.INSTANCE); } } }
@Override protected T getValue(Object receiver, CreationalContext<T> creationalContext) { return producerMethod.invoke(receiver, creationalContext); }
/** * Add an annotation to the type declaration. * * @param annotation the annotation instance to add * @throws IllegalArgumentException if the annotation is null */ public AnnotatedTypeBuilder<X> addToClass(Annotation annotation) { typeAnnotations.add(annotation); return this; }
protected AnnotatedCallableImpl(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, Type[] genericTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType, Map<Integer, Type> parameterTypeOverrides) { super(declaringType, member, memberType, annotations, genericType, null); this.parameters = getAnnotatedParameters(this, parameterTypes, genericTypes, parameterAnnotations, parameterTypeOverrides); }
/** * Remove an annotation from the type * * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType */ public AnnotatedTypeBuilder<X> removeFromClass(Class<? extends Annotation> annotationType) { typeAnnotations.remove(annotationType); return this; }
GenericProducerField(Bean<T> originalBean, GenericIdentifier identifier, AnnotatedField<X> field, Set<Annotation> qualifiers, Set<Annotation> declaringBeanQualifiers, Class<? extends Annotation> scopeOverride, boolean alternative, Class<?> declaringBeanClass, BeanManager beanManager) { super(originalBean, identifier, qualifiers, declaringBeanQualifiers, scopeOverride, Annotateds.createFieldId(field), alternative, declaringBeanClass, beanManager); this.field = field; }
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return annotations.isAnnotationPresent(annotationType); }
public static <T> Comparator<AnnotatedMethod<? super T>> instance() { return new AnnotatedMethodComparator<T>(); }
public <T extends Annotation> T getAnnotation(Class<T> annotationType) { return annotations.getAnnotation(annotationType); }
public Set<Annotation> getAnnotations() { return annotations.getAnnotations(); }
public static <T> Comparator<AnnotatedConstructor<? super T>> instance() { return new AnnotatedConstructorComparator<T>(); }
/** * Reads the annotations from an existing java type. Annotations already * present will be overwritten * * @param type the type to read from * @throws IllegalArgumentException if type is null */ public AnnotatedTypeBuilder<X> readFromType(Class<X> type) { return readFromType(type, true); }
public void redefine(RedefinitionContext<Disposes> ctx) { // Add the marker qualifier ctx.getAnnotationBuilder().add(GenericMarkerLiteral.INSTANCE).add(genericBeanQualifier); }
@Override protected T getValue(Object receiver, CreationalContext<T> creationalContext) { return producerMethod.invoke(receiver, creationalContext); }
public AnnotationBuilder addAll(Set<Annotation> annotations) { for (Annotation annotation : annotations) { add(annotation); } return this; }