/** * Remove an annotation from the specified method. * * @param method the method to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * method is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromMethod(Method method, Class<? extends Annotation> annotationType) { if (methods.get(method) == null) { throw new IllegalArgumentException("Method " + method + " not present on class" + getJavaClass()); } else { methods.get(method).remove(annotationType); } return this; }
/** * Remove an annotation from the specified field. * * @param field the field to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * field is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromField(Field field, Class<? extends Annotation> annotationType) { if (fields.get(field) == null) { throw new IllegalArgumentException("field " + field + " not present on class " + getJavaClass()); } else { fields.get(field).remove(annotationType); } return this; }
/** * Remove an annotation from the specified method. * * @param method the method to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * method is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromMethod(Method method, Class<? extends Annotation> annotationType) { if (methods.get(method) == null) { throw new IllegalArgumentException("Method " + method + " not present on class" + getJavaClass()); } else { methods.get(method).remove(annotationType); } return this; }
/** * Remove an annotation from the specified field. * * @param field the field to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * field is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromField(Field field, Class<? extends Annotation> annotationType) { if (fields.get(field) == null) { throw new IllegalArgumentException("field " + field + " not present on class " + getJavaClass()); } else { fields.get(field).remove(annotationType); } return this; }
/** * Remove an annotation from the specified field. * * @param field the field to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * field is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromField(Field field, Class<? extends Annotation> annotationType) { if (fields.get(field) == null) { throw new IllegalArgumentException("field " + field + " not present on class " + getJavaClass()); } else { fields.get(field).remove(annotationType); } return this; }
/** * Remove an annotation from the specified method. * * @param method the method to remove the annotation from * @param annotationType the annotation type to remove * @throws IllegalArgumentException if the annotationType is null or if the * method is not currently declared on the type */ public AnnotatedTypeBuilder<X> removeFromMethod(Method method, Class<? extends Annotation> annotationType) { if (methods.get(method) == null) { throw new IllegalArgumentException("Method " + method + " not present on class" + getJavaClass()); } else { methods.get(method).remove(annotationType); } return this; }
throw new IllegalArgumentException("Method " + method + " not present on class " + getJavaClass()); method, position, getJavaClass()));
throw new IllegalArgumentException("Method " + method + " not present on class " + getJavaClass()); method, position, getJavaClass()));
throw new IllegalArgumentException("Method " + method + " not present on class " + getJavaClass()); method, position, getJavaClass()));
private <T> void processClass(AnnotatedTypeBuilder<T> builder, String name, boolean isSingleton, boolean scopeIsPresent) { logger.trace("processing class: {} singleton: {} scopeIsPresent: {}", name, isSingleton, scopeIsPresent); if (!scopeIsPresent) { if (!isSingleton || builder.getJavaClass().getFields().length > 0) { builder.addToClass(createDependentAnnotation()); } else { builder.addToClass(createApplicationScopedAnnotation()); // For Singleton normally only ApplicationScoped } } builder.addToClass(createDefaultAnnotation()); if (!name.isEmpty()) { builder.addToClass(new EjbName.EjbNameLiteral(name)); } else { builder.addToClass(DefaultLiteral.INSTANCE); } }