public List<Annotated<Class<?>>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); Set<Class<?>> classes = findMetaAnnotatedClasses(annotation, new HashSet<Class<?>>()); List<Annotated<Class<?>>> list = new LinkedList<Annotated<Class<?>>>(); for (Class<?> clazz : classes) { if (Annotation.class.isAssignableFrom(clazz) && isMetaAnnotation((Class<? extends Annotation>) clazz)) continue; list.add(new MetaAnnotatedClass(clazz)); } return list; }
public List<Annotated<Class<?>>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); Set<Class<?>> classes = findMetaAnnotatedClasses(annotation, new HashSet<Class<?>>()); List<Annotated<Class<?>>> list = new ArrayList<Annotated<Class<?>>>(); for (Class<?> clazz : classes) { if (Annotation.class.isAssignableFrom(clazz) && isMetaAnnotation((Class<? extends Annotation>) clazz)) continue; list.add(new MetaAnnotatedClass(clazz)); } return list; }
public List<Annotated<Class<?>>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation) { classesNotLoaded.clear(); Set<Class<?>> classes = findMetaAnnotatedClasses(annotation, new HashSet<Class<?>>()); List<Annotated<Class<?>>> list = new LinkedList<Annotated<Class<?>>>(); for (Class<?> clazz : classes) { if (Annotation.class.isAssignableFrom(clazz) && isMetaAnnotation((Class<? extends Annotation>) clazz)) continue; list.add(new MetaAnnotatedClass(clazz)); } return list; }
private Set<Class<?>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation, Set<Class<?>> classes) { List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof ClassInfo) { ClassInfo classInfo = (ClassInfo) info; try { Class clazz = classInfo.get(); if (classes.contains(clazz)) continue; // double check via proper reflection if (clazz.isAnnotationPresent(annotation)) { classes.add(clazz); } String meta = info.getMetaAnnotationName(); if (meta != null) { classes.addAll(findMetaAnnotatedClasses((Class<? extends Annotation>) clazz, classes)); } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return classes; }
private Set<Class<?>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation, Set<Class<?>> classes) { List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof ClassInfo) { ClassInfo classInfo = (ClassInfo) info; try { Class clazz = classInfo.get(); if (classes.contains(clazz)) continue; // double check via proper reflection if (clazz.isAnnotationPresent(annotation)) { classes.add(clazz); } String meta = info.getMetaAnnotationName(); if (meta != null) { classes.addAll(findMetaAnnotatedClasses((Class<? extends Annotation>) clazz, classes)); } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return classes; }
private Set<Class<?>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation, Set<Class<?>> classes) { List<Info> infos = getAnnotationInfos(annotation.getName()); for (Info info : infos) { if (info instanceof ClassInfo) { ClassInfo classInfo = (ClassInfo) info; try { Class clazz = classInfo.get(); if (classes.contains(clazz)) continue; // double check via proper reflection if (clazz.isAnnotationPresent(annotation)) { classes.add(clazz); } String meta = info.getMetaAnnotationName(); if (meta != null) { classes.addAll(findMetaAnnotatedClasses((Class<? extends Annotation>) clazz, classes)); } } catch (ClassNotFoundException e) { classesNotLoaded.add(classInfo.getName()); } } } return classes; }
private void processAsynchronous(final EnterpriseBean bean, final AnnotationFinder annotationFinder) { if (!(bean instanceof SessionBean)) { return; } final SessionBean sessionBean = (SessionBean) bean; for (final Annotated<Method> method : annotationFinder.findMetaAnnotatedMethods(Asynchronous.class)) { sessionBean.getAsyncMethod().add(new AsyncMethod(method.get())); } //Spec 4.5.1 @Asynchronous could be used at the class level of a bean-class ( or superclass ). //Seems that it should not be used on the any interface view for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(Asynchronous.class)) { if (!clazz.get().isInterface()) { sessionBean.getAsynchronousClasses().add(clazz.get().getName()); } } }
private void processAsynchronous(final EnterpriseBean bean, final AnnotationFinder annotationFinder) { if (!(bean instanceof SessionBean)) { return; } final SessionBean sessionBean = (SessionBean) bean; for (final Annotated<Method> method : annotationFinder.findMetaAnnotatedMethods(Asynchronous.class)) { sessionBean.getAsyncMethod().add(new AsyncMethod(method.get())); } //Spec 4.5.1 @Asynchronous could be used at the class level of a bean-class ( or superclass ). //Seems that it should not be used on the any interface view for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(Asynchronous.class)) { if (!clazz.get().isInterface()) { sessionBean.getAsynchronousClasses().add(clazz.get().getName()); } } }
public void load() { final AnnotationFinder finder = new AnnotationFinder(new CompositeArchive(thisArchive(), cpArchive())).enableFindSubclasses(); for (final Annotated<Class<?>> clazz : finder.findMetaAnnotatedClasses(Editor.class)) { PropertyEditorManager.registerEditor(clazz.getAnnotation(Editor.class).value(), clazz.get()); } } }
final List<Annotated<Class<?>>> types = sortClasses(annotationFinder.findMetaAnnotatedClasses(annotationClass)); if (!hasMethodAttribute("*", null, existingDeclarations)) { for (final Annotated<Class<?>> type : types) {
final List<Annotated<Class<?>>> types = sortClasses(annotationFinder.findMetaAnnotatedClasses(annotationClass)); if (!hasMethodAttribute("*", null, existingDeclarations)) { for (final Annotated<Class<?>> type : types) {
final List<Annotated<Class<?>>> annotatedClasses = sortClasses(annotationFinder.findMetaAnnotatedClasses(Interceptors.class)); for (final Annotated<Class<?>> interceptorsAnnotatedClass : annotatedClasses) { final Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);
final List<Annotated<Class<?>>> annotatedClasses = sortClasses(annotationFinder.findMetaAnnotatedClasses(Interceptors.class)); for (final Annotated<Class<?>> interceptorsAnnotatedClass : annotatedClasses) { final Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);