Class Annotations


  • public class Annotations
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Set<java.lang.reflect.Method> ANNOTATION_METHODS
      Capture all methods defined by the annotation interface
      private static java.util.regex.Pattern p  
      private static java.lang.String PREFIX_CONSTANT
      Constant for the prefix constant.
      private static java.lang.String VALUE_METHOD
      Constant for the single element method
    • Constructor Summary

      Constructors 
      Constructor Description
      Annotations()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.Object coerceToArray​(java.lang.Class<?> componentType, java.lang.Object raw, org.osgi.framework.Bundle bundle)  
      private static java.util.Map<java.lang.String,​java.util.List<java.util.Map<java.lang.String,​java.lang.Object>>> extractSubMaps​(java.util.Collection<java.lang.String> keys, java.util.Map<java.lang.String,​java.lang.Object> map)  
      static java.lang.String getPrefix​(java.lang.Class<?> clazz)  
      static boolean isSingleElementAnnotation​(java.lang.Class<?> clazz)
      Check whether the provided type is a single element annotation.
      (package private) static java.lang.String mapIdentifierToKey​(java.lang.String name)  
      (package private) static java.lang.String mapTypeNameToKey​(java.lang.String name)  
      static <T> T toObject​(java.lang.Class<T> clazz, java.util.Map<java.lang.String,​java.lang.Object> props, org.osgi.framework.Bundle b, boolean supportsInterfaces)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ANNOTATION_METHODS

        private static final java.util.Set<java.lang.reflect.Method> ANNOTATION_METHODS
        Capture all methods defined by the annotation interface
      • VALUE_METHOD

        private static final java.lang.String VALUE_METHOD
        Constant for the single element method
        See Also:
        Constant Field Values
      • PREFIX_CONSTANT

        private static final java.lang.String PREFIX_CONSTANT
        Constant for the prefix constant.
        See Also:
        Constant Field Values
      • p

        private static final java.util.regex.Pattern p
    • Constructor Detail

      • Annotations

        public Annotations()
    • Method Detail

      • isSingleElementAnnotation

        public static boolean isSingleElementAnnotation​(java.lang.Class<?> clazz)
        Check whether the provided type is a single element annotation. A single element annotation has a method named "value" and all other annotation methods must have a default value.
        Parameters:
        clazz - The provided type
        Returns:
        true if the type is a single element annotation.
      • getPrefix

        public static java.lang.String getPrefix​(java.lang.Class<?> clazz)
      • toObject

        public static <T> T toObject​(java.lang.Class<T> clazz,
                                     java.util.Map<java.lang.String,​java.lang.Object> props,
                                     org.osgi.framework.Bundle b,
                                     boolean supportsInterfaces)
      • extractSubMaps

        private static java.util.Map<java.lang.String,​java.util.List<java.util.Map<java.lang.String,​java.lang.Object>>> extractSubMaps​(java.util.Collection<java.lang.String> keys,
                                                                                                                                                   java.util.Map<java.lang.String,​java.lang.Object> map)
      • coerceToArray

        private static java.lang.Object coerceToArray​(java.lang.Class<?> componentType,
                                                      java.lang.Object raw,
                                                      org.osgi.framework.Bundle bundle)
      • mapIdentifierToKey

        static java.lang.String mapIdentifierToKey​(java.lang.String name)
      • mapTypeNameToKey

        static java.lang.String mapTypeNameToKey​(java.lang.String name)