@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; }
/** * 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; }
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; }
protected boolean isBeanAnnotatedClass(ClassInfo classInfo) { for (AnnotationFinder.AnnotationInfo annotationInfo : classInfo.getAnnotations()) { if (isBeanAnnotation(annotationInfo)) { 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 isSelfAnnotated(ClassInfo classInfo, String metatype) { if (!classInfo.isAnnotation()) return false; final String name = classInfo.getName(); if (!hasName(name, metatype)) return false; for (AnnotationInfo info : classInfo.getAnnotations()) { if (info.getName().equals(name)) return true; } return true; }
private boolean isSelfAnnotated(ClassInfo classInfo, String metatype) { if (!classInfo.isAnnotation()) return false; final String name = classInfo.getName(); if (!hasName(name, metatype)) return false; for (AnnotationInfo info : classInfo.getAnnotations()) { if (info.getName().equals(name)) return true; } return true; }
private boolean isSelfAnnotated(ClassInfo classInfo, String metatype) { if (!classInfo.isAnnotation()) return false; final String name = classInfo.getName(); if (!hasName(name, metatype)) return false; for (AnnotationInfo info : classInfo.getAnnotations()) { if (info.getName().equals(name)) return true; } return true; }