final PackageInfo info = new PackageInfo(aPackage); for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); if (!annotationInfos.contains(info)) { annotationInfos.add(info); List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); annotationInfos.add(info);
public Annotatable(AnnotatedElement element) { for (Annotation annotation : getAnnotations(element)) { annotations.add(new AnnotationInfo(Type.getType(annotation.annotationType()).getDescriptor())); } }
final PackageInfo info = new PackageInfo(aPackage); for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); if (!annotationInfos.contains(info)) { annotationInfos.add(info); List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); annotationInfos.add(info);
final PackageInfo info = new PackageInfo(aPackage); for (AnnotationInfo annotation : info.getAnnotations()) { List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); if (!annotationInfos.contains(info)) { annotationInfos.add(info); List<Info> annotationInfos = initAnnotationInfos(annotation.getName()); annotationInfos.add(info);
/** * This method is called for classes from bean archives with * bean-discovery-mode 'annotated'. * * This method is intended to be overwritten in integration scenarios and e.g. * allows to add other criterias for keeping the class. * * @param classInfo * @return true if this class should be kept and further get picked up as CDI Bean */ protected boolean isBeanAnnotatedClass(AnnotationFinder.ClassInfo classInfo) { // check whether this class has 'scope' annotations or a stereotype for (AnnotationFinder.AnnotationInfo annotationInfo : classInfo.getAnnotations()) { if (Interceptor.class.getName().equals(annotationInfo.getName()) || Decorator.class.getName().equals(annotationInfo.getName()) || isBeanAnnotation(annotationInfo)) { return true; } } return false; }
protected boolean isBeanAnnotation(AnnotationFinder.AnnotationInfo annotationInfo) { String annotationName = annotationInfo.getName(); // TODO add caches try { Class<? extends Annotation> annotationType = (Class<? extends Annotation>) WebBeansUtil.getCurrentClassLoader().loadClass(annotationName); boolean isBeanAnnotation = webBeansContext().getBeanManagerImpl().isScope(annotationType); if (!isBeanAnnotation) { isBeanAnnotation = webBeansContext().getBeanManagerImpl().isStereotype(annotationType); } return isBeanAnnotation; } catch (ClassNotFoundException e) { return false; } }
@Override public String getMetaAnnotationName() { for (AnnotationInfo info : getAnnotations()) { for (Class<? extends Annotation> metaroot : metaroots) { if (info.getName().equals(metaroot.getName())) return name; } } if (name.endsWith("$$")) { ClassInfo info = classInfos.get(name.substring(0, name.length() - 2)); if (info != null) { return info.getMetaAnnotationName(); } } return null; }
@Override public String getMetaAnnotationName() { for (AnnotationInfo info : getAnnotations()) { for (Class<? extends Annotation> metaroot : metaroots) { if (info.getName().equals(metaroot.getName())) return name; } } if (name.endsWith("$$")) { ClassInfo info = classInfos.get(name.substring(0, name.length() - 2)); if (info != null) { return info.getMetaAnnotationName(); } } return null; }
@Override public String getMetaAnnotationName() { for (AnnotationInfo info : getAnnotations()) { for (Class<? extends Annotation> metaroot : metaroots) { if (info.getName().equals(metaroot.getName())) return name; } } if (name.endsWith("$$")) { ClassInfo info = classInfos.get(name.substring(0, name.length() - 2)); if (info != null) { return info.getMetaAnnotationName(); } } return null; }
private void index(AnnotationInfo annotationInfo, Info info) { initAnnotationInfos(annotationInfo.getName()).add(info); }
private void index(AnnotationInfo annotationInfo, Info info) { initAnnotationInfos(annotationInfo.getName()).add(info); }
private boolean isMetaRoot(ClassInfo classInfo) { if (!classInfo.isAnnotation()) return false; if (classInfo.getName().equals("javax.annotation.Metatype")) return true; if (isSelfAnnotated(classInfo, "Metatype")) return true; if (isSelfAnnotated(classInfo, "Metaroot")) return false; for (AnnotationInfo annotationInfo : classInfo.getAnnotations()) { final ClassInfo annotation = classInfos.get(annotationInfo.getName()); if (annotation == null) return false; if (annotation.getName().equals("javax.annotation.Metaroot")) return true; if (isSelfAnnotated(annotation, "Metaroot")) return true; } return false; }
private void index(AnnotationInfo annotationInfo, Info info) { initAnnotationInfos(annotationInfo.getName()).add(info); }
private boolean isMetaRoot(ClassInfo classInfo) { if (!classInfo.isAnnotation()) return false; if (classInfo.getName().equals("javax.annotation.Metatype")) return true; if (isSelfAnnotated(classInfo, "Metatype")) return true; if (isSelfAnnotated(classInfo, "Metaroot")) return false; for (AnnotationInfo annotationInfo : classInfo.getAnnotations()) { final ClassInfo annotation = classInfos.get(annotationInfo.getName()); if (annotation == null) return false; if (annotation.getName().equals("javax.annotation.Metaroot")) return true; if (isSelfAnnotated(annotation, "Metaroot")) return true; } return false; }
private boolean isMetaRoot(ClassInfo classInfo) { if (!classInfo.isAnnotation()) return false; if (classInfo.getName().equals("javax.annotation.Metatype")) return true; if (isSelfAnnotated(classInfo, "Metatype")) return true; if (isSelfAnnotated(classInfo, "Metaroot")) return false; for (AnnotationInfo annotationInfo : classInfo.getAnnotations()) { final ClassInfo annotation = classInfos.get(annotationInfo.getName()); if (annotation == null) return false; if (annotation.getName().equals("javax.annotation.Metaroot")) return true; if (isSelfAnnotated(annotation, "Metaroot")) return true; } return false; }
private boolean isBeanAnnotation(AnnotationInfo annotationInfo) { return beanDefiningAnnotations.contains(annotationInfo.getName()); } }
@Override public AnnotationVisitor visitMethodParameterAnnotation(int param, String desc, boolean visible) { MethodInfo methodInfo = ((MethodInfo) info); List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param); AnnotationInfo annotationInfo = new AnnotationInfo(desc); annotationInfos.add(annotationInfo); ParameterInfo parameterInfo = new ParameterInfo(methodInfo, param); methodInfo.getParameters().add(parameterInfo); index(annotationInfo, parameterInfo); return new InfoBuildingVisitor(annotationInfo).annotationVisitor(); } }
@Override public AnnotationVisitor visitParameterAnnotation(int param, String desc, boolean visible) { MethodInfo methodInfo = ((MethodInfo) info); List<AnnotationInfo> annotationInfos = methodInfo.getParameterAnnotations(param); AnnotationInfo annotationInfo = new AnnotationInfo(desc); annotationInfos.add(annotationInfo); return new InfoBuildingVisitor(annotationInfo); } }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { AnnotationInfo annotationInfo = new AnnotationInfo(desc); info.getAnnotations().add(annotationInfo); index(annotationInfo, info); return new InfoBuildingVisitor(annotationInfo); }
public Annotatable(AnnotatedElement element) { for (Annotation annotation : getAnnotations(element)) { annotations.add(new AnnotationInfo(Type.getType(annotation.annotationType()).getDescriptor())); } }