Class AnnotatedMethodList

    • Method Detail

      • create

        public static AnnotatedMethodList create​(Class<?> cls,
                                                 boolean declaredMethods)
        Create an annotated method list for a class.

        The method list contains all methods available on the class or declared methods only, depending on the value of the declaredMethods parameter.

        The bridge methods and methods declared directly on the Object class are filtered out.

        Parameters:
        cls - class from which the method list is created
        declaredMethods - if true only the declared methods will be included in the method list; otherwise all methods will be listed
        Returns:
        an AnnotatedMethodList containing AnnotatedMethod instances for the methods of the specified class
      • isNotPublic

        public AnnotatedMethodList isNotPublic()
        Get a new sub-list of methods containing all the methods from this method list that are not public.
        Returns:
        new filtered method sub-list.
      • hasParameterCount

        public AnnotatedMethodList hasParameterCount​(int paramCount)
        Get a new sub-list of methods containing all the methods from this method list that have the specific number of parameters.
        Parameters:
        paramCount - number of method parameters.
        Returns:
        new filtered method sub-list.
      • hasReturnType

        public AnnotatedMethodList hasReturnType​(Class<?> returnType)
        Get a new sub-list of methods containing all the methods from this method list that declare the specified return type.
        Parameters:
        returnType - method return type.
        Returns:
        new filtered method sub-list.
      • nameStartsWith

        public AnnotatedMethodList nameStartsWith​(String prefix)
        Get a new sub-list of methods containing all the methods from this method list with a specified method name prefix.
        Parameters:
        prefix - method name prefix.
        Returns:
        new filtered method sub-list.
      • withAnnotation

        public <T extends AnnotationAnnotatedMethodList withAnnotation​(Class<T> annotation)
        Get a new sub-list of methods containing all the methods from this method list with a specified method-level annotation declared.
        Type Parameters:
        T - annotation type.
        Parameters:
        annotation - annotation class.
        Returns:
        new filtered method sub-list.
      • withMetaAnnotation

        public <T extends AnnotationAnnotatedMethodList withMetaAnnotation​(Class<T> annotation)
        Get a new sub-list of methods containing all the methods from this method list with a method-level annotation declared that is itself annotated with a specified meta-annotation.
        Type Parameters:
        T - meta-annotation type.
        Parameters:
        annotation - meta-annotation class.
        Returns:
        new filtered method sub-list.
      • withoutAnnotation

        public <T extends AnnotationAnnotatedMethodList withoutAnnotation​(Class<T> annotation)
        Get a new sub-list of methods containing all the methods from this method list without a specified method-level annotation declared.
        Type Parameters:
        T - annotation type.
        Parameters:
        annotation - annotation class.
        Returns:
        new filtered method sub-list.
      • withoutMetaAnnotation

        public <T extends AnnotationAnnotatedMethodList withoutMetaAnnotation​(Class<T> annotation)
        Get a new sub-list of methods containing all the methods from this method list without any method-level annotation declared that would itself be annotated with a specified meta-annotation.
        Type Parameters:
        T - meta-annotation type.
        Parameters:
        annotation - meta-annotation class.
        Returns:
        new filtered method sub-list.