Class DefaultClassAnalyzer

    • Constructor Detail

      • DefaultClassAnalyzer

        public DefaultClassAnalyzer​(ServiceLocatorImpl locator)
        The DefaultClassAnalyzer is per ServiceLocatorImpl
        Parameters:
        locator - The non-null locator associated with this analyzer
    • Method Detail

      • getInitializerMethods

        public <T> Set<Method> getInitializerMethods​(Class<T> clazz)
                                              throws MultiException
        Description copied from interface: ClassAnalyzer
        Will return the set of initializer method to be used when initializing this service

        The default implementation will return all methods marked with Inject or that have a parameter that is covered by an InjectionResolver and the InjectionResolver.isMethodParameterIndicator() is set to true. Also, any method that has a parameter marked with SubscribeTo will NOT be returned, as these methods are instead meant to be called when an event is fired

        Specified by:
        getInitializerMethods in interface ClassAnalyzer
        Parameters:
        clazz - the non-null class to analyze
        Returns:
        A non-null but possibly empty set of initialization methods
        Throws:
        MultiException - on an error when analyzing the class
      • getFields

        public <T> Set<Field> getFields​(Class<T> clazz)
                                 throws MultiException
        Description copied from interface: ClassAnalyzer
        Will return the set of initializer fields to be used when initializing this service

        The default implementation will return all fields marked with Inject or that have a parameter that is covered by an InjectionResolver

        Specified by:
        getFields in interface ClassAnalyzer
        Parameters:
        clazz - the non-null class to analyze
        Returns:
        A non-null but possibly empty set of initialization fields
        Throws:
        MultiException - on an error when analyzing the class
      • getPostConstructMethod

        public <T> Method getPostConstructMethod​(Class<T> clazz)
                                          throws MultiException
        Description copied from interface: ClassAnalyzer
        Will return the postConstruct method of the class

        The default implementation will return the PostConstruct.postConstruct() method or the method annotated with PostConstruct

        Specified by:
        getPostConstructMethod in interface ClassAnalyzer
        Parameters:
        clazz - the non-null class to analyze
        Returns:
        A possibly null method representing the postConstruct method to call
        Throws:
        MultiException - on an error when analyzing the class
      • getPreDestroyMethod

        public <T> Method getPreDestroyMethod​(Class<T> clazz)
                                       throws MultiException
        Description copied from interface: ClassAnalyzer
        Will return the preDestroy method of the class

        The default implementation will return the PreDestroy.preDestroy() method or the method annotated with PreDestroy

        Specified by:
        getPreDestroyMethod in interface ClassAnalyzer
        Parameters:
        clazz - the non-null class to analyze
        Returns:
        A possibly null method representing the preDestroy method to call
        Throws:
        MultiException - on an error when analyzing the class