Author: hadrian
Date: Wed Oct 22 23:05:38 2008
New Revision: 707280

URL: http://svn.apache.org/viewvc?rev=707280&view=rev
Log:
CAMEL-990.

Modified:
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java?rev=707280&r1=707279&r2=707280&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
 Wed Oct 22 23:05:38 2008
@@ -128,12 +128,21 @@
      */
     public static class AnnotatedWith implements Test {
         private Class<? extends Annotation> annotation;
+        private boolean checkMetaAnnotations;
 
         /**
          * Constructs an AnnotatedWith test for the specified annotation type.
          */
         public AnnotatedWith(Class<? extends Annotation> annotation) {
+            this(annotation, false);
+        }
+
+        /**
+         * Constructs an AnnotatedWith test for the specified annotation type.
+         */
+        public AnnotatedWith(Class<? extends Annotation> annotation, boolean 
checkMetaAnnotations) {
             this.annotation = annotation;
+            this.checkMetaAnnotations = checkMetaAnnotations;
         }
 
         /**
@@ -153,11 +162,12 @@
             if (clazz.isAnnotationPresent(annotationType)) {
                 return true;
             }
-            // check for meta annotations
-            for (Annotation a : clazz.getAnnotations()) {
-                for (Annotation meta : a.annotationType().getAnnotations()) {
-                    if 
(meta.annotationType().getName().equals(annotationType.getName())) {
-                        return true;
+            if (checkMetaAnnotations) {
+                for (Annotation a : clazz.getAnnotations()) {
+                    for (Annotation meta : 
a.annotationType().getAnnotations()) {
+                        if 
(meta.annotationType().getName().equals(annotationType.getName())) {
+                            return true;
+                        }
                     }
                 }
             }


Reply via email to