Class InheritableMethodExtractor

  • All Implemented Interfaces:
    MethodExtractor

    public class InheritableMethodExtractor
    extends UnitypeMethodExtractor

    A two-level MethodExtractor where the super type acts as an additional source of information, e.g. accessing annotations in method filters.

    Author:
    Brennan Spies
    • Constructor Detail

      • InheritableMethodExtractor

        public InheritableMethodExtractor​(Class<T> owningType,
                                          Class<? super T> superType)
        Creates a MethodExtractor with a super type that acts as an additional source of information for MethodFilters, e.g. in exposing annotations. In most cases, the super type will be an interface.
        Type Parameters:
        T - The Type of the method class
        Parameters:
        owningType - The method type to be proxied
        superType - Any super type of the method type
    • Method Detail

      • getProxyableMethods

        public Collection<Method> getProxyableMethods()
        Returns all methods that can be proxied. This excludes methods that are private, static, or final.
        Returns:
        All methods that can be proxied
      • getPublicMethods

        public Collection<Method> getPublicMethods()
        Returns all public methods that are proxyable.
        Returns:
        All public methods
      • getMethods

        public Collection<Method> getMethods​(MethodFilter filter)
        Returns accessible methods that pass the given filter.
        Parameters:
        filter - The method filter
        Returns:
        The filtered methods
      • isObjectMethod

        protected boolean isObjectMethod​(Method method)
        True if the method is declared by java.lang.Object.
        Overrides:
        isObjectMethod in class UnitypeMethodExtractor
        Parameters:
        method - The method
        Returns:
        True if this method is declared by Object
      • isProxyable

        protected boolean isProxyable​(Method method)
        Determines if the given method is proxyable.
        Overrides:
        isProxyable in class UnitypeMethodExtractor
        Parameters:
        method - The method to test
        Returns:
        True if method is proxyable