Class AnnotationClassParser


  • public final class AnnotationClassParser
    extends Object
    Helper methods for parsing metadata from configuration annotation classes.
    • Method Detail

      • isContextAwareConfig

        public static boolean isContextAwareConfig​(Class<?> clazz)
        Checks if the given class is suitable to be mapped with context-aware configuration. The given class has to be an annotation class, and the Configuration annotation has to be present.
        Parameters:
        clazz - Given class
        Returns:
        True if class is suitable for context-aware configuration
      • getConfigurationName

        public static String getConfigurationName​(Class<?> clazz)
        Get configuration name for given configuration annotation class.
        Parameters:
        clazz - Annotation class
        Returns:
        Configuration name
      • getPropertyName

        public static String getPropertyName​(String methodName)
        Implements the method name mapping as defined in OSGi R6 Compendium specification, Chapter 112. Declarative Services Specification, Chapter 112.8.2.1. Component Property Mapping.
        Parameters:
        methodName - Method name
        Returns:
        Mapped property name
      • buildConfigurationMetadata

        public static org.apache.sling.caconfig.spi.metadata.ConfigurationMetadata buildConfigurationMetadata​(Class<?> clazz)
        Build configuration metadata by parsing the given annotation interface class and it's configuration annotations.
        Parameters:
        clazz - Configuration annotation class
        Returns:
        Configuration metadata