You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xbean-scm@geronimo.apache.org by db...@apache.org on 2011/12/17 20:49:41 UTC

svn commit: r1215562 - in /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder: AnnotationFinder.java MetaAnnotatedObject.java

Author: dblevins
Date: Sat Dec 17 19:49:40 2011
New Revision: 1215562

URL: http://svn.apache.org/viewvc?rev=1215562&view=rev
Log:
XBEAN-198: Support for proposed @javax.annotation.Metatype and @javax.annotation.Metaroot annotations

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/MetaAnnotatedObject.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java?rev=1215562&r1=1215561&r2=1215562&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java (original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java Sat Dec 17 19:49:40 2011
@@ -189,12 +189,14 @@ public class AnnotationFinder implements
     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;
         }
 

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/MetaAnnotatedObject.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/MetaAnnotatedObject.java?rev=1215562&r1=1215561&r2=1215562&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/MetaAnnotatedObject.java (original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/MetaAnnotatedObject.java Sat Dec 17 19:49:40 2011
@@ -220,9 +220,11 @@ public abstract class MetaAnnotatedObjec
     }
 
     private static boolean isMetatypeAnnotation(Class<? extends Annotation> type) {
+        if (type.getName().equals("javax.annotation.Metatype")) return true;
         if (isSelfAnnotated(type, "Metatype")) return true;
 
         for (Annotation annotation : type.getAnnotations()) {
+            if (type.getName().equals("javax.annotation.Metaroot")) return true;
             if (isSelfAnnotated(annotation.annotationType(), "Metaroot")) return true;
         }