Author: cziegeler
Date: Wed May 18 14:03:10 2011
New Revision: 1124271

URL: http://svn.apache.org/viewvc?rev=1124271&view=rev
Log:
FELIX-2957 - Filter scope should be an array

Modified:
    felix/trunk/scrplugin/annotations/changelog.txt
    
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilter.java
    
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilterScope.java
    
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingAnnotationTagProvider.java
    
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingServletPropertyTag.java

Modified: felix/trunk/scrplugin/annotations/changelog.txt
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/changelog.txt?rev=1124271&r1=1124270&r2=1124271&view=diff
==============================================================================
--- felix/trunk/scrplugin/annotations/changelog.txt (original)
+++ felix/trunk/scrplugin/annotations/changelog.txt Wed May 18 14:03:10 2011
@@ -2,6 +2,7 @@ Changes from 1.5.0 to 1.6.0
 ---------------------------
 
 ** Bug
+    * [FELIX-2957] - Filter scope should be an array
     * [FELIX-2943] - Component generated by @SlingServlet does not match 
default settings of @Component
 
 ** Improvement

Modified: 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilter.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilter.java?rev=1124271&r1=1124270&r2=1124271&view=diff
==============================================================================
--- 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilter.java
 (original)
+++ 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilter.java
 Wed May 18 14:03:10 2011
@@ -18,11 +18,7 @@
  */
 package org.apache.felix.scr.annotations.sling;
 
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
 
 /**
  * Marks servlet classes as SCR component, and allows to add a
@@ -46,12 +42,12 @@ public @interface SlingFilter {
     int order();
 
     /**
-     * The scope of a filter.
+     * The scopes of a filter.
      * If the filter has request scope, it is run once for a request.
      * If the filter has component scope, it is run once for every included
      * component (rendering).
      */
-    SlingFilterScope scope() default SlingFilterScope.REQUEST;
+    SlingFilterScope[] scope() default SlingFilterScope.REQUEST;
 
     /**
      * Whether to generate a default SCR component tag with. If

Modified: 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilterScope.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilterScope.java?rev=1124271&r1=1124270&r2=1124271&view=diff
==============================================================================
--- 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilterScope.java
 (original)
+++ 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingFilterScope.java
 Wed May 18 14:03:10 2011
@@ -45,4 +45,10 @@ public enum SlingFilterScope {
     public String getScope() {
         return this.scope;
     }
+
+    @Override
+    public String toString() {
+        return this.getScope();
+    }
+
 }

Modified: 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingAnnotationTagProvider.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingAnnotationTagProvider.java?rev=1124271&r1=1124270&r2=1124271&view=diff
==============================================================================
--- 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingAnnotationTagProvider.java
 (original)
+++ 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingAnnotationTagProvider.java
 Wed May 18 14:03:10 2011
@@ -21,7 +21,8 @@ package org.apache.felix.scrplugin.tags.
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.felix.scr.annotations.sling.*;
+import org.apache.felix.scr.annotations.sling.SlingFilter;
+import org.apache.felix.scr.annotations.sling.SlingServlet;
 import org.apache.felix.scrplugin.tags.JavaField;
 import org.apache.felix.scrplugin.tags.JavaTag;
 import org.apache.felix.scrplugin.tags.annotation.*;
@@ -144,8 +145,8 @@ public class SlingAnnotationTagProvider 
             tags.add(new SlingServletPropertyTag(annotation, 
"service.ranking", String.valueOf(order), description, "Integer", true));
 
             // property scope
-            final SlingFilterScope scope = Util.getEnumValue(annotation, 
"scope", SlingFilterScope.class, SlingFilter.class);
-            tags.add(new SlingServletPropertyTag(annotation, 
"sling.filter.scope", scope.getScope(), description, null, true));
+            final String[] scopes = Util.getAnnotationValues(annotation, 
"scope", description);
+            tags.add(new SlingServletPropertyTag(annotation, 
"sling.filter.scope", scopes, description, true));
         }
 
         return tags;

Modified: 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingServletPropertyTag.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingServletPropertyTag.java?rev=1124271&r1=1124270&r2=1124271&view=diff
==============================================================================
--- 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingServletPropertyTag.java
 (original)
+++ 
felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/tags/annotation/sling/SlingServletPropertyTag.java
 Wed May 18 14:03:10 2011
@@ -52,6 +52,19 @@ public class SlingServletPropertyTag ext
 
     /**
      * @param name Property name
+     * @param values Property values
+     * @param desc Description
+     */
+    public SlingServletPropertyTag(Annotation annotation, String name, 
String[] values, JavaClassDescription desc, final boolean isPrivate) {
+        super(annotation, desc, null);
+        this.name = name;
+        this.values = values;
+        this.type = null;
+        this.isPrivate = isPrivate;
+    }
+
+    /**
+     * @param name Property name
      * @param value Property value
      * @param desc Description
      */


Reply via email to