Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java b/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
index 86f8caa..cafe0e3 100644
--- a/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
+++ b/bundleplugin/src/main/java/aQute/lib/osgi/Annotation.java
@@ -6,16 +6,16 @@
import aQute.bnd.annotation.metatype.*;
import aQute.lib.osgi.Descriptors.TypeRef;
-@SuppressWarnings("unchecked") public class Annotation {
+@SuppressWarnings("unchecked")
+public class Annotation {
TypeRef name;
- Map<String, Object> elements;
+ Map<String,Object> elements;
ElementType member;
RetentionPolicy policy;
- public Annotation(TypeRef name, Map<String, Object> elements, ElementType member,
- RetentionPolicy policy) {
+ public Annotation(TypeRef name, Map<String,Object> elements, ElementType member, RetentionPolicy policy) {
this.name = name;
- if ( elements == null)
+ if (elements == null)
this.elements = Collections.emptyMap();
else
this.elements = elements;
@@ -30,11 +30,11 @@
public ElementType getElementType() {
return member;
}
-
+
public RetentionPolicy getRetentionPolicy() {
return policy;
}
-
+
public String toString() {
return name + ":" + member + ":" + policy + ":" + elements;
}
@@ -56,19 +56,20 @@
public Set<String> keySet() {
if (elements == null)
return Collections.emptySet();
-
+
return elements.keySet();
}
+
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception {
String cname = name.getFQN();
Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname);
return getAnnotation(c);
}
- public <T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> c)
- throws Exception {
+
+ public <T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> c) throws Exception {
String cname = name.getFQN();
- if ( ! c.getName().equals(cname))
+ if (!c.getName().equals(cname))
return null;
- return Configurable.createConfigurable(c, elements );
+ return Configurable.createConfigurable(c, elements);
}
}