diff --git a/scrplugin/pom.xml b/scrplugin/pom.xml
index 5810d8c..a4247c4 100644
--- a/scrplugin/pom.xml
+++ b/scrplugin/pom.xml
@@ -58,11 +58,11 @@
 		</dependency>
 		
 		<dependency>
-		   <groupId>asm</groupId>
-		   <artifactId>asm-all</artifactId>
-		   <version>3.0</version>
+		    <groupId>asm</groupId>
+		    <artifactId>asm-all</artifactId>
+		    <version>3.1</version>
 		</dependency>
-		
+
 		<dependency>
 		    <groupId>commons-io</groupId>
 		    <artifactId>commons-io</artifactId>
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
index 55e41a3..a8e4a73 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
@@ -534,6 +534,8 @@
                 if (StringUtils.isEmpty(type)) {
                     if ( reference.getField() != null ) {
                         type = reference.getField().getType();
+                    } else {
+                        throw new MojoExecutionException("Interface missing for reference " + refName + " in class " + reference.getJavaClassDescription().getName());
                     }
                 } else if ( isInspectedClass ) {
                     // check if the value points to a class/interface
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/ClassUtil.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/ClassUtil.java
index 496c00f..e774483 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/ClassUtil.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/ClassUtil.java
@@ -26,13 +26,15 @@
  */
 public class ClassUtil {
 
+    public static ClassLoader classLoader;
+
     /**
      * Try to get the initial value of a static field
      * @param clazz     The class.
      * @param fieldName The name of the field.
      * @return The initial value or null.
      */
-    public static String[] getInitializationExpression(Class clazz, String fieldName) {
+    public static String[] getInitializationExpression(Class<?> clazz, String fieldName) {
         try {
             final Field field = clazz.getDeclaredField(fieldName);
             field.setAccessible(true);
@@ -55,4 +57,21 @@
         }
         return null;
     }
+
+    /**
+     * Get the compiled class.
+     */
+    public static Class<?> getClass(String name) {
+        if ( classLoader == null ) {
+            return null;
+        }
+        try {
+            if ( name.endsWith(".class") ) {
+                name = name.substring(0, name.length() - 6);
+            }
+            return classLoader.loadClass(name);
+        } catch (ClassNotFoundException e) {
+            return null;
+        }
+    }
 }
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/JavaClassDescriptorManager.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/JavaClassDescriptorManager.java
index aeefe9b..d6480ee 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/JavaClassDescriptorManager.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/JavaClassDescriptorManager.java
@@ -105,6 +105,7 @@
         this.project = project;
         this.annotationTagProviderManager = new AnnotationTagProviderManager(annotationTagProviders);
         this.classloader = this.getCompileClassLoader();
+        ClassUtil.classLoader = this.classloader;
 
         // get all the class sources through qdox
         this.log.debug("Setting up QDox");
@@ -302,6 +303,25 @@
         return list;
     }
 
+    /**
+     * Get the url for the target directory
+     */
+    protected URL getOutputDirectory()
+    throws MojoFailureException {
+        final String targetDirectory = this.getProject().getBuild().getOutputDirectory();
+        try {
+            return new File(targetDirectory).toURI().toURL();
+        } catch (IOException ioe) {
+            throw new MojoFailureException("Unable to add target directory to classloader.");
+        }
+    }
+
+    /**
+     * Create a class loader containing all compile artifacts including
+     * the target/class directory of the current project
+     * @return The class loader
+     * @throws MojoFailureException
+     */
     protected ClassLoader getCompileClassLoader()
     throws MojoFailureException {
         @SuppressWarnings("unchecked")
@@ -316,12 +336,8 @@
                 throw new MojoFailureException("Unable to get compile class loader.");
             }
         }
-        final String targetDirectory = this.getProject().getBuild().getOutputDirectory();
-        try {
-            path[path.length - 1] = new File(targetDirectory).toURI().toURL();
-        } catch (IOException ioe) {
-            throw new MojoFailureException("Unable to add target directory to classloader.");
-        }
+        path[path.length - 1] = this.getOutputDirectory();
+
         return new URLClassLoader(path, this.getClass().getClassLoader());
     }
 
@@ -397,7 +413,7 @@
                 if ( javaClass.getFullyQualifiedName().equals(className) ) {
                     try {
                         // check for java annotation descriptions - fallback to QDox if none found
-                        Class clazz = this.classloader.loadClass(className);
+                        Class<?> clazz = this.classloader.loadClass(className);
                         if (this.processAnnotations && getAnnotationTagProviderManager().hasScrPluginAnnotation(javaClass)) {
                             this.log.debug("Found java annotation description for: " + className);
                             result = new AnnotationJavaClassDescription(clazz, this.sources[index], this);
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaClassDescription.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaClassDescription.java
index a74d16d..5a17a05 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaClassDescription.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaClassDescription.java
@@ -19,7 +19,6 @@
 package org.apache.felix.scrplugin.tags.annotation;
 
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
 import java.util.*;
 
 import org.apache.felix.scrplugin.tags.*;
@@ -40,7 +39,7 @@
      * @param source QDox source
      * @param manager description manager
      */
-    public AnnotationJavaClassDescription(Class clazz, JavaSource source, JavaClassDescriptorManager manager) {
+    public AnnotationJavaClassDescription(Class<?> clazz, JavaSource source, JavaClassDescriptorManager manager) {
         super(clazz, source, manager);
     }
 
@@ -84,6 +83,14 @@
                 }
             }
         }
+        for(com.thoughtworks.qdox.model.Annotation annotation : this.javaClass.getAnnotations()) {
+            List<JavaTag> annotationTags = manager.getAnnotationTagProviderManager().getTags(annotation, this);
+            for (JavaTag tag : annotationTags) {
+                if (tag.getName().equals(name)) {
+                    tags.add(tag);
+                }
+            }
+        }
 
         if (inherited && this.getSuperClass() != null) {
             final JavaTag[] superTags = this.getSuperClass().getTagsByName(name, inherited);
@@ -100,7 +107,10 @@
      */
     @Override
     public JavaField[] getFields() {
-        final Field[] fields = this.clazz.getDeclaredFields();
+        final com.thoughtworks.qdox.model.JavaField fields[] = this.javaClass.getFields();
+        if ( fields == null || fields.length == 0 ) {
+            return new JavaField[0];
+        }
         final JavaField[] javaFields = new JavaField[fields.length];
         for (int i = 0; i < fields.length; i++) {
             javaFields[i] = new AnnotationJavaField(fields[i], this);
@@ -113,14 +123,7 @@
      */
     @Override
     public JavaField getFieldByName(String name) throws MojoExecutionException {
-        Field field = null;
-        try {
-            field = this.clazz.getField(name);
-        } catch (SecurityException e) {
-            // ignore
-        } catch (NoSuchFieldException e) {
-            // ignore
-        }
+        final com.thoughtworks.qdox.model.JavaField field = this.javaClass.getFieldByName(name);
         if (field != null) {
             return new AnnotationJavaField(field, this);
         }
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaField.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaField.java
index d2edabc..d4d40ea 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaField.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationJavaField.java
@@ -18,20 +18,16 @@
  */
 package org.apache.felix.scrplugin.tags.annotation;
 
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
 import java.util.List;
 
-import org.apache.felix.scrplugin.tags.ClassUtil;
-import org.apache.felix.scrplugin.tags.JavaField;
-import org.apache.felix.scrplugin.tags.JavaTag;
+import org.apache.felix.scrplugin.tags.*;
 
 /**
  * Description of a java field
  */
 public class AnnotationJavaField implements JavaField {
 
-    protected final Field field;
+    protected final com.thoughtworks.qdox.model.JavaField field;
 
     protected final AnnotationJavaClassDescription description;
 
@@ -39,7 +35,7 @@
      * @param field Field
      * @param description description
      */
-    public AnnotationJavaField(Field field, AnnotationJavaClassDescription description) {
+    public AnnotationJavaField(com.thoughtworks.qdox.model.JavaField field, AnnotationJavaClassDescription description) {
         this.field = field;
         this.description = description;
     }
@@ -62,16 +58,15 @@
      * @see JavaField#getTagByName(String)
      */
     public JavaTag getTagByName(String name) {
-        for (Annotation annotation : this.field.getAnnotations()) {
-            List<JavaTag> tags = description.getManager().getAnnotationTagProviderManager().getTags(annotation,
-                    this.description, this);
+        for(com.thoughtworks.qdox.model.Annotation annotation : this.field.getAnnotations()) {
+            List<JavaTag> tags =  description.getManager().getAnnotationTagProviderManager().getTags(annotation, this.description, this);
             for (JavaTag tag : tags) {
                 if (tag.getName().equals(name)) {
                     return tag;
                 }
-
             }
         }
+
         return null;
     }
 
@@ -79,7 +74,7 @@
      * @see JavaField#getType()
      */
     public String getType() {
-        return this.field.getType().getName();
+        return this.field.getType().getValue();
     }
 
 }
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationTagProviderManager.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationTagProviderManager.java
index 0083367..943c62d 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationTagProviderManager.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/AnnotationTagProviderManager.java
@@ -56,7 +56,7 @@
         // add custom providers defined in pom
         for (int i = 0; i < annotationTagProviderClasses.length; i++) {
             try {
-                Class clazz = Class.forName(annotationTagProviderClasses[i]);
+                Class<?> clazz = Class.forName(annotationTagProviderClasses[i]);
                 try {
                     annotationTagProviders.add((AnnotationTagProvider) clazz.newInstance());
                 } catch (ClassCastException e) {
@@ -140,7 +140,7 @@
      * @param pClass Class
      * @return true if SCR plugin java annotation found
      */
-    public boolean hasScrPluginAnnotation(Class pClass) {
+    public boolean hasScrPluginAnnotation(Class<?> pClass) {
         for (Annotation annotation : pClass.getAnnotations()) {
             if (getTags(annotation, null).size() > 0) {
                 return true;
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
index 6352043..5817b69 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
@@ -52,47 +52,47 @@
         this.annotation = new Component() {
 
             public boolean componentAbstract() {
-                return Util.getValue(annotation, "componentAbstract", false);
+                return Util.getBooleanValue(annotation, "componentAbstract", Component.class);
             }
 
             public boolean createPid() {
-                return Util.getValue(annotation, "createPid", true);
+                return Util.getBooleanValue(annotation, "createPid", Component.class);
             }
 
             public String description() {
-                return Util.getValue(annotation, "description", "");
+                return Util.getStringValue(annotation, "description", Component.class);
             }
 
             public boolean ds() {
-                return Util.getValue(annotation, "ds", true);
+                return Util.getBooleanValue(annotation, "ds", Component.class);
             }
 
             public boolean enabled() {
-                return Util.getValue(annotation, "enabled", true);
+                return Util.getBooleanValue(annotation, "enabled", Component.class);
             }
 
             public String factory() {
-                return Util.getValue(annotation, "factory", "");
+                return Util.getStringValue(annotation, "factory", Component.class);
             }
 
             public boolean immediate() {
-                return Util.getValue(annotation, "immediate", false);
+                return Util.getBooleanValue(annotation, "immediate", Component.class);
             }
 
             public boolean inherit() {
-                return Util.getValue(annotation, "inherit", true);
+                return Util.getBooleanValue(annotation, "inherit", Component.class);
             }
 
             public String label() {
-                return Util.getValue(annotation, "label", "");
+                return Util.getStringValue(annotation, "label", Component.class);
             }
 
             public boolean metatype() {
-                return Util.getValue(annotation, "metatype", false);
+                return Util.getBooleanValue(annotation, "metatype", Component.class);
             }
 
             public String name() {
-                return Util.getValue(annotation, "name", "");
+                return Util.getStringValue(annotation, "name", Component.class);
             }
 
             public Class<? extends java.lang.annotation.Annotation> annotationType() {
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/DefaultAnnotationTagProvider.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/DefaultAnnotationTagProvider.java
index 9023e60..671a51b 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/DefaultAnnotationTagProvider.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/DefaultAnnotationTagProvider.java
@@ -80,26 +80,29 @@
         if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Component.class.getName())) {
             tags.add(new ComponentTag(annotation, description));
         } else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Property.class.getName())) {
-            //tags.add(new PropertyTag(annotation, description));
+            tags.add(new PropertyTag(annotation, description));
         } else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Service.class.getName())) {
-            //tags.add(new ServiceTag(annotation, description));
+            tags.add(new ServiceTag(annotation, description));
         } else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Reference.class.getName())) {
-            //tags.add(new ReferenceTag(annotation, description, field));
+            tags.add(new ReferenceTag(annotation, description, field));
         }
 
         // check for multi-annotations
         else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Properties.class.getName())) {
-            //for (Property property : ((Properties) annotation).value()) {
-            //    tags.add(new PropertyTag(property, description));
-            //}
+            final com.thoughtworks.qdox.model.Annotation[] properties = (com.thoughtworks.qdox.model.Annotation[])annotation.getNamedParameter("value");
+            for (com.thoughtworks.qdox.model.Annotation property : properties) {
+                tags.add(new PropertyTag(property, description));
+            }
         } else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(Services.class.getName())) {
-            //for (Service service : ((Services) annotation).value()) {
-            //    tags.add(new ServiceTag(service, description));
-            //}
+            final com.thoughtworks.qdox.model.Annotation[] services = (com.thoughtworks.qdox.model.Annotation[])annotation.getNamedParameter("value");
+            for (com.thoughtworks.qdox.model.Annotation service : services) {
+                tags.add(new ServiceTag(service, description));
+            }
         } else if (annotation.getType().getJavaClass().getFullyQualifiedName().equals(References.class.getName())) {
-            //for (Reference reference : ((References) annotation).value()) {
-            //    tags.add(new ReferenceTag(reference, description, field));
-            //}
+            final com.thoughtworks.qdox.model.Annotation[] references = (com.thoughtworks.qdox.model.Annotation[])annotation.getNamedParameter("value");
+            for (com.thoughtworks.qdox.model.Annotation reference : references) {
+                tags.add(new ReferenceTag(reference, description, field));
+            }
         }
 
         return tags;
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
index 0fc24a0..279a234 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
@@ -24,6 +24,8 @@
 import org.apache.felix.scrplugin.annotations.*;
 import org.apache.felix.scrplugin.tags.JavaClassDescription;
 
+import com.thoughtworks.qdox.model.Annotation;
+
 /**
  * Description of a java tag for components.
  */
@@ -40,6 +42,61 @@
         this.annotation = annotation;
     }
 
+    /**
+     * @param annotation Annotation
+     * @param desc Description
+     */
+    public PropertyTag(final Annotation annotation, JavaClassDescription desc) {
+        super(desc, null);
+        this.annotation = new Property() {
+
+            public int cardinality() {
+                return Util.getIntValue(annotation, "cardinality", Property.class);
+            }
+
+            public String description() {
+                return Util.getStringValue(annotation, "description", Property.class);
+            }
+
+            public String label() {
+                return Util.getStringValue(annotation, "label", Property.class);
+            }
+
+            public String name() {
+                return Util.getStringValue(annotation, "name", Property.class);
+            }
+
+            public PropertyOption[] options() {
+                final Object obj = annotation.getNamedParameter("options");
+                if ( obj != null ) {
+                    return (PropertyOption[])obj;
+                }
+                try {
+                    return (PropertyOption[]) Property.class.getMethod("options").getDefaultValue();
+                } catch( NoSuchMethodException mnfe) {
+                    // we ignore this
+                    return null;
+                }
+            }
+
+            public boolean propertyPrivate() {
+                return Util.getBooleanValue(annotation, "propertyPrivate", Property.class);
+            }
+
+            public Class<?> type() {
+                return Util.getClassValue(annotation, "type", Property.class);
+            }
+
+            public String[] value() {
+                return Util.getStringValues(annotation, "value", Property.class);
+            }
+
+            public Class<? extends java.lang.annotation.Annotation> annotationType() {
+                return null;
+            }
+        };
+    }
+
     @Override
     public String getName() {
         return Constants.PROPERTY;
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ReferenceTag.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ReferenceTag.java
index 4cf97e7..f7c67eb 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ReferenceTag.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ReferenceTag.java
@@ -22,11 +22,12 @@
 import java.util.Map;
 
 import org.apache.felix.scrplugin.Constants;
-import org.apache.felix.scrplugin.annotations.AutoDetect;
-import org.apache.felix.scrplugin.annotations.Reference;
+import org.apache.felix.scrplugin.annotations.*;
 import org.apache.felix.scrplugin.tags.JavaClassDescription;
 import org.apache.felix.scrplugin.tags.JavaField;
 
+import com.thoughtworks.qdox.model.Annotation;
+
 /**
  * Description of a java tag for components.
  */
@@ -44,6 +45,81 @@
         this.annotation = annotation;
     }
 
+    /**
+     * @param annotation Annotation
+     * @param desc Description
+     */
+    public ReferenceTag(final Annotation annotation, JavaClassDescription desc, JavaField field) {
+        super(desc, field);
+
+        this.annotation = new Reference() {
+
+            public String bind() {
+                return Util.getStringValue(annotation, "bind", Reference.class);
+            }
+
+            public ReferenceCardinality cardinality() {
+                final Object obj = annotation.getNamedParameter("cardinality");
+                if ( obj != null ) {
+                    if ( obj instanceof ReferenceCardinality ) {
+                        return (ReferenceCardinality)obj;
+                    }
+                    return ReferenceCardinality.values()[(Integer)obj];
+                }
+                try {
+                    return (ReferenceCardinality) Reference.class.getMethod("cardinality").getDefaultValue();
+                } catch( NoSuchMethodException mnfe) {
+                    // we ignore this
+                    return null;
+                }
+            }
+
+            public boolean checked() {
+                return Util.getBooleanValue(annotation, "checked", Reference.class);
+            }
+
+            public String name() {
+                return Util.getStringValue(annotation, "name", Reference.class);
+            }
+
+            public ReferencePolicy policy() {
+                final Object obj = annotation.getNamedParameter("policy");
+                if ( obj != null ) {
+                    if ( obj instanceof ReferencePolicy ) {
+                        return (ReferencePolicy)obj;
+                    }
+                    return ReferencePolicy.values()[(Integer)obj];
+                }
+                try {
+                    return (ReferencePolicy) Reference.class.getMethod("policy").getDefaultValue();
+                } catch( NoSuchMethodException mnfe) {
+                    // we ignore this
+                    return null;
+                }
+            }
+
+            public Class<?> referenceInterface() {
+                return Util.getClassValue(annotation, "referenceInterface", Reference.class);
+            }
+
+            public String strategy() {
+                return Util.getStringValue(annotation, "strategy", Reference.class);
+            }
+
+            public String target() {
+                return Util.getStringValue(annotation, "target", Reference.class);
+            }
+
+            public String unbind() {
+                return Util.getStringValue(annotation, "unbind", Reference.class);
+            }
+
+            public Class<? extends java.lang.annotation.Annotation> annotationType() {
+                return null;
+            }
+        };
+    }
+
     @Override
     public String getName() {
         return Constants.REFERENCE;
@@ -55,11 +131,10 @@
 
         map.put(Constants.REFERENCE_NAME, emptyToNull(this.annotation.name()));
 
-        String referenceInterface = null;
         if (this.annotation.referenceInterface() != AutoDetect.class) {
-            referenceInterface = this.annotation.referenceInterface().getName();
+            String referenceInterface = this.annotation.referenceInterface().getName();
+            map.put(Constants.REFERENCE_INTERFACE, referenceInterface);
         }
-        map.put(Constants.REFERENCE_INTERFACE, referenceInterface);
 
         map.put(Constants.REFERENCE_CARDINALITY, this.annotation.cardinality().getCardinalityString());
         map.put(Constants.REFERENCE_POLICY, this.annotation.policy().getPolicyString());
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ServiceTag.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ServiceTag.java
index 7578f25..512751f 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ServiceTag.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ServiceTag.java
@@ -26,6 +26,8 @@
 import org.apache.felix.scrplugin.annotations.Service;
 import org.apache.felix.scrplugin.tags.JavaClassDescription;
 
+import com.thoughtworks.qdox.model.Annotation;
+
 /**
  * Description of a java tag for components.
  */
@@ -42,6 +44,28 @@
         this.annotation = annotation;
     }
 
+    /**
+     * @param annotation Annotation
+     * @param desc Description
+     */
+    public ServiceTag(final Annotation annotation, JavaClassDescription desc) {
+        super(desc, null);
+        this.annotation = new Service() {
+
+            public boolean serviceFactory() {
+                return Util.getBooleanValue(annotation, "serviceFactory", Service.class);
+            }
+
+            public Class<?> value() {
+                return Util.getClassValue(annotation, "value", Service.class);
+            }
+
+            public Class<? extends java.lang.annotation.Annotation> annotationType() {
+                return null;
+            }
+        };
+    }
+
     @Override
     public String getName() {
         return Constants.SERVICE;
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
index 7cc3239..4478fe6 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
@@ -18,11 +18,13 @@
  */
 package org.apache.felix.scrplugin.tags.annotation.defaulttag;
 
+import org.apache.felix.scrplugin.tags.ClassUtil;
+
 import com.thoughtworks.qdox.model.Annotation;
 
 public abstract class Util {
 
-    public static boolean getValue(Annotation annotation, String name, boolean defaultValue) {
+    public static boolean getBooleanValue(Annotation annotation, String name, final Class<?> clazz) {
         final Object obj = annotation.getNamedParameter(name);
         if ( obj != null ) {
             if ( obj instanceof String ) {
@@ -32,10 +34,46 @@
             }
             return Boolean.valueOf(obj.toString());
         }
-        return defaultValue;
+        try {
+            return (Boolean) clazz.getMethod(name).getDefaultValue();
+        } catch( NoSuchMethodException mnfe) {
+            // we ignore this
+            return true;
+        }
     }
 
-    public static String getValue(Annotation annotation, String name, String defaultValue) {
+    public static int getIntValue(Annotation annotation, String name, final Class<?> clazz) {
+        final Object obj = annotation.getNamedParameter(name);
+        if ( obj != null ) {
+            if ( obj instanceof String ) {
+                return Integer.valueOf((String)obj);
+            } else if ( obj instanceof Number ) {
+                return ((Number)obj).intValue();
+            }
+            return Integer.valueOf(obj.toString());
+        }
+        try {
+            return (Integer) clazz.getMethod(name).getDefaultValue();
+        } catch( NoSuchMethodException mnfe) {
+            // we ignore this
+            return 0;
+        }
+    }
+
+    public static String[] getStringValues(Annotation annotation, String name, final Class<?> clazz) {
+        final Object obj = annotation.getNamedParameter(name);
+        if ( obj != null ) {
+            return (String[])obj;
+        }
+        try {
+            return (String[]) clazz.getMethod(name).getDefaultValue();
+        } catch( NoSuchMethodException mnfe) {
+            // we ignore this
+            return null;
+        }
+    }
+
+    public static String getStringValue(Annotation annotation, String name, final Class<?> clazz) {
         final Object obj = annotation.getNamedParameter(name);
         if ( obj != null ) {
             if ( obj instanceof String ) {
@@ -43,6 +81,27 @@
             }
             return obj.toString();
         }
-        return defaultValue;
+        try {
+            return (String) clazz.getMethod(name).getDefaultValue();
+        } catch( NoSuchMethodException mnfe) {
+            // we ignore this
+            return "";
+        }
+    }
+
+    public static Class<?> getClassValue(Annotation annotation, String name, final Class<?> clazz) {
+        final Object obj = annotation.getNamedParameter(name);
+        if ( obj != null ) {
+            if ( obj instanceof Class ) {
+                return (Class<?>)obj;
+            }
+            return ClassUtil.getClass(obj.toString());
+        }
+        try {
+            return (Class<?>) clazz.getMethod(name).getDefaultValue();
+        } catch( NoSuchMethodException mnfe) {
+            // we ignore this
+            return null;
+        }
     }
 }
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
index 064e996..ee9a049 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
@@ -46,9 +46,9 @@
     protected final JavaSource source;
 
     /** The compiled class. */
-    protected final Class clazz;
+    protected final Class<?> clazz;
 
-    public QDoxJavaClassDescription(Class clazz, JavaSource source, JavaClassDescriptorManager m) {
+    public QDoxJavaClassDescription(Class<?> clazz, JavaSource source, JavaClassDescriptorManager m) {
         this.javaClass = source.getClasses()[0];
         this.manager = m;
         this.source = source;
@@ -419,7 +419,7 @@
         return getName();
     }
 
-    public Class getCompiledClass() {
+    public Class<?> getCompiledClass() {
         return this.clazz;
     }
 }
