felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1349822 - in /felix/trunk/scrplugin: annotations/src/main/java/org/apache/felix/scrplugin/ annotations/src/main/java/org/apache/felix/scrplugin/processing/ annotations/src/main/resources/META-INF/services/ generator/src/main/java/org/apach...
Date Wed, 13 Jun 2012 13:08:06 GMT
Author: cziegeler
Date: Wed Jun 13 13:08:05 2012
New Revision: 1349822

URL: http://svn.apache.org/viewvc?rev=1349822&view=rev
Log:
FELIX-3550 : Reimplement the SCR Generator

Added:
    felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/
    felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java   (contents, props changed)
      - copied, changed from r1349781, felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SCRAnnotationProcessor.java
    felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java   (contents, props changed)
      - copied, changed from r1349781, felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SlingAnnotationProcessor.java
    felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.annotations.AnnotationProcessor
      - copied, changed from r1349781, felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.AnnotationProcessor
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java   (contents, props changed)
      - copied, changed from r1349780, felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/Source.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java   (with props)
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java   (with props)
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java   (with props)
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java   (with props)
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java   (with props)
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java   (with props)
Removed:
    felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SCRAnnotationProcessor.java
    felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SlingAnnotationProcessor.java
    felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.AnnotationProcessor
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/AnnotationProcessor.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Implementation.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/ClassAnnotation.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/FieldAnnotation.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/MethodAnnotation.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/ScannedAnnotation.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/ScannedClass.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/Source.java
Modified:
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Project.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Result.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/AbstractDescription.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ComponentDescription.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/PropertyDescription.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ReferenceDescription.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ServiceDescription.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/AnnotationProcessorManager.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/ClassScanner.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/AbstractObject.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Component.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Interface.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Property.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
    felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/MavenProjectScanner.java
    felix/trunk/scrplugin/scrtask/src/main/java/org/apache/felix/scrplugin/ant/SCRDescriptorTask.java

Copied: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java (from r1349781, felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SCRAnnotationProcessor.java)
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java?p2=felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java&p1=felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SCRAnnotationProcessor.java&r1=1349781&r2=1349822&rev=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SCRAnnotationProcessor.java (original)
+++ felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java Wed Jun 13 13:08:05 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.scrplugin;
+package org.apache.felix.scrplugin.processing;
 
 import java.lang.reflect.Array;
 import java.lang.reflect.Modifier;
@@ -34,6 +34,14 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.felix.scr.annotations.Services;
+import org.apache.felix.scrplugin.SCRDescriptorException;
+import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+import org.apache.felix.scrplugin.annotations.AnnotationProcessor;
+import org.apache.felix.scrplugin.annotations.ClassAnnotation;
+import org.apache.felix.scrplugin.annotations.FieldAnnotation;
+import org.apache.felix.scrplugin.annotations.MethodAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedClass;
 import org.apache.felix.scrplugin.description.ClassDescription;
 import org.apache.felix.scrplugin.description.ComponentConfigurationPolicy;
 import org.apache.felix.scrplugin.description.ComponentDescription;
@@ -47,11 +55,6 @@ import org.apache.felix.scrplugin.descri
 import org.apache.felix.scrplugin.description.ReferenceStrategy;
 import org.apache.felix.scrplugin.description.ServiceDescription;
 import org.apache.felix.scrplugin.description.SpecVersion;
-import org.apache.felix.scrplugin.scanner.ClassAnnotation;
-import org.apache.felix.scrplugin.scanner.FieldAnnotation;
-import org.apache.felix.scrplugin.scanner.MethodAnnotation;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
-import org.apache.felix.scrplugin.scanner.ScannedClass;
 
 /**
  * This is the processor for the Apache Felix SCR annotations.

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java (from r1349781, felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SlingAnnotationProcessor.java)
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java?p2=felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java&p1=felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SlingAnnotationProcessor.java&r1=1349781&r2=1349822&rev=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/SlingAnnotationProcessor.java (original)
+++ felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java Wed Jun 13 13:08:05 2012
@@ -16,21 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.scrplugin;
+package org.apache.felix.scrplugin.processing;
 
 import java.util.List;
 
 import org.apache.felix.scr.annotations.sling.SlingFilter;
 import org.apache.felix.scr.annotations.sling.SlingFilterScope;
 import org.apache.felix.scr.annotations.sling.SlingServlet;
+import org.apache.felix.scrplugin.SCRDescriptorException;
+import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+import org.apache.felix.scrplugin.annotations.AnnotationProcessor;
+import org.apache.felix.scrplugin.annotations.ClassAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedClass;
 import org.apache.felix.scrplugin.description.ClassDescription;
 import org.apache.felix.scrplugin.description.ComponentConfigurationPolicy;
 import org.apache.felix.scrplugin.description.ComponentDescription;
 import org.apache.felix.scrplugin.description.PropertyDescription;
 import org.apache.felix.scrplugin.description.PropertyType;
 import org.apache.felix.scrplugin.description.ServiceDescription;
-import org.apache.felix.scrplugin.scanner.ClassAnnotation;
-import org.apache.felix.scrplugin.scanner.ScannedClass;
 
 /**
  * This is the processor for the Apache Felix Sling annotations.

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: felix/trunk/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SlingAnnotationProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.annotations.AnnotationProcessor (from r1349781, felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.AnnotationProcessor)
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.annotations.AnnotationProcessor?p2=felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.annotations.AnnotationProcessor&p1=felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.AnnotationProcessor&r1=1349781&r2=1349822&rev=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.AnnotationProcessor (original)
+++ felix/trunk/scrplugin/annotations/src/main/resources/META-INF/services/org.apache.felix.scrplugin.annotations.AnnotationProcessor Wed Jun 13 13:08:05 2012
@@ -1,2 +1,2 @@
-org.apache.felix.scrplugin.SCRAnnotationProcessor
-org.apache.felix.scrplugin.SlingAnnotationProcessor
+org.apache.felix.scrplugin.processing.SCRAnnotationProcessor
+org.apache.felix.scrplugin.processing.SlingAnnotationProcessor

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java Wed Jun 13 13:08:05 2012
@@ -23,7 +23,9 @@ import java.util.Map;
 
 import org.apache.felix.scrplugin.description.SpecVersion;
 
-
+/**
+ * Options for the {@link SCRDescriptorGenerator}
+ */
 public class Options {
 
     private boolean generateAccessors = true;

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Project.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Project.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Project.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Project.java Wed Jun 13 13:08:05 2012
@@ -21,8 +21,10 @@ package org.apache.felix.scrplugin;
 import java.io.File;
 import java.util.Collection;
 
-import org.apache.felix.scrplugin.scanner.Source;
 
+/**
+ * Project description for the {@link SCRDescriptorGenerator}
+ */
 public class Project {
 
     private Collection<Source> sources;

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Result.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Result.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Result.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Result.java Wed Jun 13 13:08:05 2012
@@ -22,7 +22,7 @@ import java.util.List;
 
 
 /**
- * The result of the generation.
+ * The result of the {@link SCRDescriptorGenerator}.
  */
 public class Result {
 

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java Wed Jun 13 13:08:05 2012
@@ -26,6 +26,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.felix.scrplugin.annotations.AnnotationProcessor;
 import org.apache.felix.scrplugin.description.ClassDescription;
 import org.apache.felix.scrplugin.description.ComponentDescription;
 import org.apache.felix.scrplugin.description.PropertyDescription;
@@ -43,7 +44,6 @@ import org.apache.felix.scrplugin.helper
 import org.apache.felix.scrplugin.om.Component;
 import org.apache.felix.scrplugin.om.Components;
 import org.apache.felix.scrplugin.om.Context;
-import org.apache.felix.scrplugin.om.Implementation;
 import org.apache.felix.scrplugin.om.Interface;
 import org.apache.felix.scrplugin.om.Property;
 import org.apache.felix.scrplugin.om.Reference;
@@ -411,10 +411,6 @@ public class SCRDescriptorGenerator {
             ocd = null;
         }
 
-        // Create implementation object
-        final Implementation impl = new Implementation(desc.getDescribedClass().getName());
-        comp.setImplementation(impl);
-
         final Map<String, Reference> allReferences = new HashMap<String, Reference>();
         final Map<String, Property> allProperties = new HashMap<String, Property>();
 

Copied: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java (from r1349780, felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/Source.java)
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java?p2=felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java&p1=felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/Source.java&r1=1349780&r2=1349822&rev=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/scanner/Source.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java Wed Jun 13 13:08:05 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.scrplugin.scanner;
+package org.apache.felix.scrplugin;
 
 import java.io.File;
 

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Source.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import org.apache.felix.scrplugin.SCRDescriptorException;
+import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+import org.apache.felix.scrplugin.description.ClassDescription;
+
+/**
+ * This service provides a plugin for annotation processing. Custom tags
+ * can be processed.
+ * On a scanned class all available annotation processors are called in
+ * order of their {@link #getRanking()} value (lowest value first).
+ */
+public interface AnnotationProcessor {
+
+    /**
+     * Processes annotations from the provided scanned class and adds
+     * descriptions to the object model based on the read annotations.
+     *
+     * If this service processes an annotation, it should remove this
+     * annotation from the provided list to avoid duplicate processing
+     * by other processors (with higher ranking)
+     *
+     * @param scannedClass The scanned class.
+     * @param describedClass The description container.
+     */
+    void process(final ScannedClass scannedClass,
+            final ClassDescription describedClass)
+    throws SCRDescriptorException, SCRDescriptorFailureException;
+
+    /**
+     * The ranking of this processor.
+     */
+    int getRanking();
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/AnnotationProcessor.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import java.util.Map;
+
+/**
+ * A class annotation
+ */
+public class ClassAnnotation extends ScannedAnnotation {
+
+    /**
+     * Constructor.
+     */
+    public ClassAnnotation(final String name, final Map<String, Object> values) {
+        super(name, values);
+    }
+
+    @Override
+    public String toString() {
+        return "ClassAnnotationDescription [name=" + name + ", values="
+                + values + "]";
+    }
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ClassAnnotation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+
+import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+
+/**
+ * A field annotation
+ */
+public class FieldAnnotation extends ScannedAnnotation {
+
+    /**
+     * Corresponding field in the class.
+     */
+    private final Field annotatedField;
+
+    /**
+     * Constructor.
+     */
+    public FieldAnnotation(final String name, final Map<String, Object> values, final Field f) {
+        super(name, values);
+        this.annotatedField = f;
+    }
+
+    /**
+     * Get the annotated field.
+     */
+    public Field getAnnotatedField() {
+        return this.annotatedField;
+    }
+
+    /**
+     * Get the initial value of the value if this is a static field.
+     * @throws SCRDescriptorFailureException
+     */
+    public Object getAnnotatedFieldValue()
+    throws SCRDescriptorFailureException {
+        if ( Modifier.isStatic(annotatedField.getModifiers()) ) {
+            try {
+                final Object value = annotatedField.get(null);
+                return value;
+            } catch (final IllegalArgumentException e) {
+                throw new SCRDescriptorFailureException("Unable to get initial field value from: " + annotatedField, e);
+            } catch (final IllegalAccessException e) {
+                throw new SCRDescriptorFailureException("Unable to get initial field value from: " + annotatedField, e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return "FieldAnnotationDescription [name=" + name + ", values="
+                + values + ", annotatedField=" + annotatedField + "]";
+    }
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/FieldAnnotation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/**
+ * A method annotation
+ */
+public class MethodAnnotation extends ScannedAnnotation {
+
+    /** The annotated method. */
+    private final Method method;
+
+    /**
+     * Constructor
+     */
+    public MethodAnnotation(final String name, final Map<String, Object> values, final Method m) {
+        super(name, values);
+        this.method = m;
+    }
+
+    /**
+     * Get the annotated method.
+     */
+    public Method getAnnotatedMethod() {
+        return this.method;
+    }
+
+    @Override
+    public String toString() {
+        return "MethodAnnotationDescription [name=" + name + ", values="
+                + values + ", method=" + method + "]";
+    }
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/MethodAnnotation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import java.util.Map;
+
+/**
+ * Base class for all annotation.
+ */
+public abstract class ScannedAnnotation {
+
+    /** The fully qualified class name */
+    protected final String name;
+
+    /** The annotation values. */
+    protected final Map<String, Object> values;
+
+    /**
+     * Create a new description
+     * @param name   The fully qualified class name of the annotation
+     * @param values The properties of the annotation (optional)
+     */
+    public ScannedAnnotation(final String name, final Map<String, Object> values) {
+        this.name = name;
+        this.values = values;
+    }
+
+    /**
+     * Get the fully qualified class name of the annotation.
+     * @return The fully qualified class name of the annotation.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Get the simple name of the annotation
+     */
+    public String getSimpleName() {
+        final int pos = name.lastIndexOf('.');
+        return name.substring(pos + 1);
+    }
+
+    /**
+     * Get a property value of the annotation.
+     * @param paramName The property name.
+     * @return The value of the property or <code>null</code>
+     */
+    public Object getValue(final String paramName) {
+        if ( values != null ) {
+            return values.get(paramName);
+        }
+        return null;
+    }
+
+    /**
+     * Get a boolean value of the annotation
+     * @param name The property name
+     * @param defaultValue A default value if the property is not set
+     * @return The property value or the default value.
+     */
+    public boolean getBooleanValue(final String name, final boolean defaultValue) {
+        final Object val = this.getValue(name);
+        if ( val != null ) {
+            return ((Boolean) val).booleanValue();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Get an integer value of the annotation
+     * @param name The property name
+     * @param defaultValue A default value if the property is not set
+     * @return The property value or the default value.
+     */
+    public int getIntegerValue(final String name, final int defaultValue) {
+        final Object val = this.getValue(name);
+        if ( val != null ) {
+            return ((Integer) val).intValue();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Get a long value of the annotation
+     * @param name The property name
+     * @param defaultValue A default value if the property is not set
+     * @return The property value or the default value.
+     */
+    public long getLongValue(final String name, final long defaultValue) {
+        final Object val = this.getValue(name);
+        if ( val != null ) {
+            return ((Long) val).intValue();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Get a string value of the annotation
+     * @param name The property name
+     * @param defaultValue A default value if the property is not set
+     * @return The property value or the default value.
+     */
+    public String getStringValue(final String name, final String defaultValue) {
+        final Object val = this.getValue(name);
+        if ( val != null && val.toString().trim().length() > 0 ) {
+            return val.toString().trim();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Get an enumeration value of the annotation
+     * @param name The property name
+     * @param defaultValue A default value if the property is not set
+     * @return The property value or the default value.
+     */
+    public String getEnumValue(final String name, final String defaultValue) {
+        final Object val = this.getValue(name);
+        if ( val != null ) {
+            return ((String[])val)[1];
+        }
+        return defaultValue;
+    }
+
+    @Override
+    public String toString() {
+        return "AnnotationDescription [name=" + name + ", values=" + values
+                + "]";
+    }
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java?rev=1349822&view=auto
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java (added)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java Wed Jun 13 13:08:05 2012
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.scrplugin.annotations;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A scanned class contains all scanned information
+ * like the found annotations.
+ */
+public class ScannedClass {
+
+    /** All found annotations .*/
+    private final List<ScannedAnnotation> descriptions = new ArrayList<ScannedAnnotation>();
+
+    /** The scanned class. */
+    private final Class<?> scannedClass;
+
+    /**
+     * Constructor
+     * @param desc List of found annotations.
+     * @param scannedClass The scanned class.
+     */
+    public ScannedClass(final List<ScannedAnnotation> desc, final Class<?> scannedClass) {
+        this.descriptions.addAll(desc);
+        this.scannedClass = scannedClass;
+    }
+
+    /**
+     * Get the scanned class.
+     * @return The scanned class.
+     */
+    public Class<?> getScannedClass() {
+        return this.scannedClass;
+    }
+
+    /**
+     * Mark an annotation as processed.
+     * A processed annotation will be removed from the list of annotations.
+     * @param desc The annotation.
+     */
+    public void processed(final ScannedAnnotation desc) {
+        this.descriptions.remove(desc);
+    }
+
+    /**
+     * Mark several annotations as processed.
+     * A processed annotation will be removed from the list of annotations.
+     * @param desc The annotation.
+     */
+    public void processed(final Collection<? extends ScannedAnnotation> desc) {
+        this.descriptions.removeAll(desc);
+    }
+
+    /**
+     * Get all class annotations
+     * @param name The name of the class annotation or <code>null</code>
+     * for all class annotations.
+     * @return A list of matching annotations or an empty list.
+     */
+    public List<ClassAnnotation> getClassAnnotations(final String name) {
+        final List<ClassAnnotation> list = new ArrayList<ClassAnnotation>();
+        for(final ScannedAnnotation desc : descriptions ) {
+            if ( desc instanceof ClassAnnotation ) {
+                if ( name == null || desc.getName().equals(name) ) {
+                    list.add( (ClassAnnotation)desc);
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * Get all field annotations
+     * @param name The name of the field annotation or <code>null</code>
+     * for all field annotations.
+     * @return A list of matching annotations or an empty list.
+     */
+    public List<FieldAnnotation> getFieldAnnotations(final String name) {
+        final List<FieldAnnotation> list = new ArrayList<FieldAnnotation>();
+        for(final ScannedAnnotation desc : descriptions ) {
+            if ( desc instanceof FieldAnnotation ) {
+                if ( name == null || desc.getName().equals(name) ) {
+                    list.add( (FieldAnnotation)desc);
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * Get all method annotations
+     * @param name The name of the method annotation or <code>null</code>
+     * for all method annotations.
+     * @return A list of matching annotations or an empty list.
+     */
+    public List<MethodAnnotation> getMethodAnnotations(final String name) {
+        final List<MethodAnnotation> list = new ArrayList<MethodAnnotation>();
+        for(final ScannedAnnotation desc : descriptions ) {
+            if ( desc instanceof MethodAnnotation ) {
+                if ( name == null || desc.getName().equals(name) ) {
+                    list.add( (MethodAnnotation)desc);
+                }
+            }
+        }
+        return list;
+    }
+}

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedClass.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/AbstractDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/AbstractDescription.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/AbstractDescription.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/AbstractDescription.java Wed Jun 13 13:08:05 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.felix.scrplugin.description;
 
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 
 /**

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ComponentDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ComponentDescription.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ComponentDescription.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ComponentDescription.java Wed Jun 13 13:08:05 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.felix.scrplugin.description;
 
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 /**
  * <code>ComponentDescription</code> is a described component.

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/PropertyDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/PropertyDescription.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/PropertyDescription.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/PropertyDescription.java Wed Jun 13 13:08:05 2012
@@ -20,7 +20,7 @@ package org.apache.felix.scrplugin.descr
 
 import java.util.Arrays;
 
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 
 /**

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ReferenceDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ReferenceDescription.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ReferenceDescription.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ReferenceDescription.java Wed Jun 13 13:08:05 2012
@@ -20,7 +20,7 @@ package org.apache.felix.scrplugin.descr
 
 import java.lang.reflect.Field;
 
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 /**
  * A <code>ReferenceDescription</code> describes a reference

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ServiceDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ServiceDescription.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ServiceDescription.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/description/ServiceDescription.java Wed Jun 13 13:08:05 2012
@@ -21,7 +21,7 @@ package org.apache.felix.scrplugin.descr
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 /**
  * If a component is a service, the {@link ClassDescription} should

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/AnnotationProcessorManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/AnnotationProcessorManager.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/AnnotationProcessorManager.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/AnnotationProcessorManager.java Wed Jun 13 13:08:05 2012
@@ -29,11 +29,11 @@ import java.util.Map;
 
 import javax.imageio.spi.ServiceRegistry;
 
-import org.apache.felix.scrplugin.AnnotationProcessor;
 import org.apache.felix.scrplugin.SCRDescriptorException;
 import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+import org.apache.felix.scrplugin.annotations.AnnotationProcessor;
+import org.apache.felix.scrplugin.annotations.ScannedClass;
 import org.apache.felix.scrplugin.description.ClassDescription;
-import org.apache.felix.scrplugin.scanner.ScannedClass;
 
 
 /**
@@ -88,7 +88,7 @@ public class AnnotationProcessorManager 
     }
 
     /**
-     * @see org.apache.felix.scrplugin.AnnotationProcessor#process(org.apache.felix.scrplugin.scanner.ScannedClass, org.apache.felix.scrplugin.description.ClassDescription)
+     * @see org.apache.felix.scrplugin.annotations.AnnotationProcessor#process(org.apache.felix.scrplugin.annotations.ScannedClass, org.apache.felix.scrplugin.description.ClassDescription)
      */
     public void process(final ScannedClass scannedClass,
             final ClassDescription describedClass)
@@ -99,7 +99,7 @@ public class AnnotationProcessorManager 
     }
 
     /**
-     * @see org.apache.felix.scrplugin.AnnotationProcessor#getRanking()
+     * @see org.apache.felix.scrplugin.annotations.AnnotationProcessor#getRanking()
      */
     public int getRanking() {
         return 0;

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/ClassScanner.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/ClassScanner.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/ClassScanner.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/ClassScanner.java Wed Jun 13 13:08:05 2012
@@ -41,19 +41,19 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
-import org.apache.felix.scrplugin.AnnotationProcessor;
 import org.apache.felix.scrplugin.Log;
 import org.apache.felix.scrplugin.Project;
 import org.apache.felix.scrplugin.SCRDescriptorException;
 import org.apache.felix.scrplugin.SCRDescriptorFailureException;
+import org.apache.felix.scrplugin.Source;
+import org.apache.felix.scrplugin.annotations.AnnotationProcessor;
+import org.apache.felix.scrplugin.annotations.ClassAnnotation;
+import org.apache.felix.scrplugin.annotations.FieldAnnotation;
+import org.apache.felix.scrplugin.annotations.MethodAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedClass;
 import org.apache.felix.scrplugin.description.ClassDescription;
 import org.apache.felix.scrplugin.description.ComponentDescription;
-import org.apache.felix.scrplugin.scanner.ClassAnnotation;
-import org.apache.felix.scrplugin.scanner.FieldAnnotation;
-import org.apache.felix.scrplugin.scanner.MethodAnnotation;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
-import org.apache.felix.scrplugin.scanner.ScannedClass;
-import org.apache.felix.scrplugin.scanner.Source;
 import org.apache.felix.scrplugin.xml.ComponentDescriptorIO;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.Type;

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/AbstractObject.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/AbstractObject.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/AbstractObject.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/AbstractObject.java Wed Jun 13 13:08:05 2012
@@ -18,28 +18,32 @@
  */
 package org.apache.felix.scrplugin.om;
 
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 import org.apache.felix.scrplugin.helper.IssueLog;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
 
 /**
  * The <code>AbstractObject</code> is the base class for the all classes of the scr om.
  */
 public abstract class AbstractObject {
 
-    private final String annotationName;
+    private final String annotationPrefix;
 
     private final String sourceLocation;
 
     protected AbstractObject(final ScannedAnnotation annotation, final String sourceLocation) {
-        this.annotationName = (annotation != null ? annotation.getName() : "<unknown>");
+        if ( annotation == null ) {
+            this.annotationPrefix = "";
+        } else {
+            this.annotationPrefix = "@" + annotation.getSimpleName()  + " : ";
+        }
         this.sourceLocation = sourceLocation;
     }
 
     protected void logWarn(IssueLog iLog, String message) {
-        iLog.addWarning("@" + this.annotationName + ": " + message, sourceLocation);
+        iLog.addWarning(this.annotationPrefix + message, sourceLocation);
     }
 
     protected void logError(IssueLog iLog, String message) {
-        iLog.addError("@" + this.annotationName + ": " + message, sourceLocation);
+        iLog.addError(this.annotationPrefix + message, sourceLocation);
     }
 }

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Component.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Component.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Component.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Component.java Wed Jun 13 13:08:05 2012
@@ -25,10 +25,10 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.felix.scrplugin.SCRDescriptorException;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 import org.apache.felix.scrplugin.description.ClassDescription;
 import org.apache.felix.scrplugin.description.ComponentConfigurationPolicy;
 import org.apache.felix.scrplugin.description.SpecVersion;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
 
 /**
  * <code>Component</code> is a described component.
@@ -48,9 +48,6 @@ public class Component extends AbstractO
     /** The factory. */
     protected String factory;
 
-    /** The implementation. */
-    protected Implementation implementation;
-
     /** All properties. */
     protected List<Property> properties = new ArrayList<Property>();
 
@@ -160,14 +157,6 @@ public class Component extends AbstractO
         this.immediate = immediate;
     }
 
-    public Implementation getImplementation() {
-        return this.implementation;
-    }
-
-    public void setImplementation(Implementation implementation) {
-        this.implementation = implementation;
-    }
-
     public Service getService() {
         return this.service;
     }
@@ -521,7 +510,7 @@ public class Component extends AbstractO
                         + (activate != null ? ", activate=" + activate : "")
                         + (deactivate != null ? ", deactivate=" + deactivate : "")
                         + (modified != null ? ", modified=" + modified : "") + ", specVersion=" + specVersion
-                        + ", implementation=" + implementation + ", service=" + service + ", properties=" + properties
+                        + ", service=" + service + ", properties=" + properties
                         + ", references=" + references + ")";
     }
 }
\ No newline at end of file

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Interface.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Interface.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Interface.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Interface.java Wed Jun 13 13:08:05 2012
@@ -19,7 +19,7 @@
 package org.apache.felix.scrplugin.om;
 
 import org.apache.felix.scrplugin.SCRDescriptorException;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 
 /**
  * <code>Interface</code>

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Property.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Property.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Property.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Property.java Wed Jun 13 13:08:05 2012
@@ -18,9 +18,9 @@
  */
 package org.apache.felix.scrplugin.om;
 
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 import org.apache.felix.scrplugin.description.PropertyType;
 import org.apache.felix.scrplugin.description.SpecVersion;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
 
 /**
  * <code>Property.java</code>...

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java Wed Jun 13 13:08:05 2012
@@ -24,12 +24,12 @@ import java.lang.reflect.Modifier;
 import java.util.Map;
 
 import org.apache.felix.scrplugin.SCRDescriptorException;
+import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
 import org.apache.felix.scrplugin.description.ReferenceCardinality;
 import org.apache.felix.scrplugin.description.ReferencePolicy;
 import org.apache.felix.scrplugin.description.ReferenceStrategy;
 import org.apache.felix.scrplugin.description.SpecVersion;
 import org.apache.felix.scrplugin.helper.StringUtils;
-import org.apache.felix.scrplugin.scanner.ScannedAnnotation;
 
 /**
  * <code>Reference.java</code>...

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java Wed Jun 13 13:08:05 2012
@@ -43,7 +43,6 @@ import org.apache.felix.scrplugin.descri
 import org.apache.felix.scrplugin.helper.IssueLog;
 import org.apache.felix.scrplugin.om.Component;
 import org.apache.felix.scrplugin.om.Components;
-import org.apache.felix.scrplugin.om.Implementation;
 import org.apache.felix.scrplugin.om.Interface;
 import org.apache.felix.scrplugin.om.Property;
 import org.apache.felix.scrplugin.om.Reference;
@@ -226,7 +225,7 @@ public class ComponentDescriptorIO {
         IOUtils.indent(contentHandler, 1);
         contentHandler.startElement(namespace, ComponentDescriptorIO.COMPONENT, ComponentDescriptorIO.COMPONENT_QNAME, ai);
         IOUtils.newline(contentHandler);
-        generateXML(component.getImplementation(), contentHandler);
+        generateImplementationXML(component, contentHandler);
         if (component.getService() != null) {
             generateXML(component.getService(), contentHandler);
         }
@@ -252,9 +251,9 @@ public class ComponentDescriptorIO {
      * @param contentHandler
      * @throws SAXException
      */
-    protected static void generateXML(Implementation implementation, ContentHandler contentHandler) throws SAXException {
+    protected static void generateImplementationXML(Component component, ContentHandler contentHandler) throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        IOUtils.addAttribute(ai, "class", implementation.getClassName());
+        IOUtils.addAttribute(ai, "class", component.getClassDescription().getDescribedClass().getName());
         IOUtils.indent(contentHandler, 2);
         contentHandler.startElement(INNER_NAMESPACE_URI, ComponentDescriptorIO.IMPLEMENTATION,
                         ComponentDescriptorIO.IMPLEMENTATION_QNAME, ai);

Modified: felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/MavenProjectScanner.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/MavenProjectScanner.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/MavenProjectScanner.java (original)
+++ felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/MavenProjectScanner.java Wed Jun 13 13:08:05 2012
@@ -26,8 +26,8 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.felix.scrplugin.Log;
+import org.apache.felix.scrplugin.Source;
 import org.apache.felix.scrplugin.helper.StringUtils;
-import org.apache.felix.scrplugin.scanner.Source;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.DirectoryScanner;

Modified: felix/trunk/scrplugin/scrtask/src/main/java/org/apache/felix/scrplugin/ant/SCRDescriptorTask.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/scrtask/src/main/java/org/apache/felix/scrplugin/ant/SCRDescriptorTask.java?rev=1349822&r1=1349821&r2=1349822&view=diff
==============================================================================
--- felix/trunk/scrplugin/scrtask/src/main/java/org/apache/felix/scrplugin/ant/SCRDescriptorTask.java (original)
+++ felix/trunk/scrplugin/scrtask/src/main/java/org/apache/felix/scrplugin/ant/SCRDescriptorTask.java Wed Jun 13 13:08:05 2012
@@ -25,8 +25,8 @@ import org.apache.felix.scrplugin.Option
 import org.apache.felix.scrplugin.SCRDescriptorException;
 import org.apache.felix.scrplugin.SCRDescriptorFailureException;
 import org.apache.felix.scrplugin.SCRDescriptorGenerator;
+import org.apache.felix.scrplugin.Source;
 import org.apache.felix.scrplugin.description.SpecVersion;
-import org.apache.felix.scrplugin.scanner.Source;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Location;
 import org.apache.tools.ant.Project;



Mime
View raw message