builder.removeFromMethodParameter(m.getJavaMember(), observerParameter.getPosition(), a.annotationType()); for (final Annotation annotation : p.getAnnotations()) { if (beanManager.isQualifier(annotation.annotationType())) { builder.removeFromMethodParameter(m.getJavaMember(), p.getPosition(), annotation.annotationType());
/** * Remove an annotation from the specified parameter. * * @param parameter the parameter to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null, if the * callable which declares the parameter is not currently declared * on the type or if the parameter is not declared on either a * constructor or a method */ public AnnotatedTypeBuilder<X> removeFromParameter(AnnotatedParameter<? super X> parameter, Class<? extends Annotation> annotationType) { if (parameter.getDeclaringCallable().getJavaMember() instanceof Method) { Method method = (Method) parameter.getDeclaringCallable().getJavaMember(); return removeFromMethodParameter(method, parameter.getPosition(), annotationType); } if (parameter.getDeclaringCallable().getJavaMember() instanceof Constructor<?>) { @SuppressWarnings("unchecked") Constructor<X> constructor = (Constructor<X>) parameter.getDeclaringCallable().getJavaMember(); return removeFromConstructorParameter(constructor, parameter.getPosition(), annotationType); } else { throw new IllegalArgumentException("Cannot remove from parameter " + parameter + " - cannot operate on member " + parameter.getDeclaringCallable().getJavaMember()); } }
/** * Remove an annotation from the specified parameter. * * @param parameter the parameter to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null, if the * callable which declares the parameter is not currently declared * on the type or if the parameter is not declared on either a * constructor or a method */ public AnnotatedTypeBuilder<X> removeFromParameter(AnnotatedParameter<? super X> parameter, Class<? extends Annotation> annotationType) { if (parameter.getDeclaringCallable().getJavaMember() instanceof Method) { Method method = (Method) parameter.getDeclaringCallable().getJavaMember(); return removeFromMethodParameter(method, parameter.getPosition(), annotationType); } if (parameter.getDeclaringCallable().getJavaMember() instanceof Constructor<?>) { @SuppressWarnings("unchecked") Constructor<X> constructor = (Constructor<X>) parameter.getDeclaringCallable().getJavaMember(); return removeFromConstructorParameter(constructor, parameter.getPosition(), annotationType); } else { throw new IllegalArgumentException("Cannot remove from parameter " + parameter + " - cannot operate on member " + parameter.getDeclaringCallable().getJavaMember()); } }
/** * Remove an annotation from the specified parameter. * * @param parameter the parameter to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null, if the * callable which declares the parameter is not currently declared * on the type or if the parameter is not declared on either a * constructor or a method */ public AnnotatedTypeBuilder<X> removeFromParameter(AnnotatedParameter<? super X> parameter, Class<? extends Annotation> annotationType) { if (parameter.getDeclaringCallable().getJavaMember() instanceof Method) { Method method = (Method) parameter.getDeclaringCallable().getJavaMember(); return removeFromMethodParameter(method, parameter.getPosition(), annotationType); } if (parameter.getDeclaringCallable().getJavaMember() instanceof Constructor<?>) { @SuppressWarnings("unchecked") Constructor<X> constructor = (Constructor<X>) parameter.getDeclaringCallable().getJavaMember(); return removeFromConstructorParameter(constructor, parameter.getPosition(), annotationType); } else { throw new IllegalArgumentException("Cannot remove from parameter " + parameter + " - cannot operate on member " + parameter.getDeclaringCallable().getJavaMember()); } }