public final class MethodList extends Object implements Iterable<AnnotatedMethod>
Modifier and Type | Class and Description |
---|---|
static interface |
MethodList.Filter
Method list filter.
|
Constructor and Description |
---|
MethodList(AnnotatedMethod... methods)
Create new method list from the given array of
annotated methods . |
MethodList(Class<?> c)
Create new method list for a class.
|
MethodList(Class<?> c,
boolean declaredMethods)
Create new method list for a class.
|
MethodList(Collection<Method> methods)
Create new method list from the given collection of methods.
|
MethodList(Method... methods)
Create new method list from the given array of methods.
|
Modifier and Type | Method and Description |
---|---|
MethodList |
filter(MethodList.Filter filter)
Created a new method list containing only the methods supported by the
method list filter . |
MethodList |
hasNumParams(int paramCount)
Get a new sub-list of methods containing all the methods from this method
list that have the specific number of parameters.
|
MethodList |
hasReturnType(Class<?> returnType)
Get a new sub-list of methods containing all the methods from this method
list that declare the specified return type.
|
MethodList |
isNotPublic()
Get a new sub-list of methods containing all the methods from this method
list that are not public.
|
Iterator<AnnotatedMethod> |
iterator()
Iterator over the list of
annotated methods contained
in this method list. |
MethodList |
nameStartsWith(String prefix)
Get a new sub-list of methods containing all the methods from this method
list with a specified method name prefix.
|
<T extends Annotation> |
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.
|
<T extends Annotation> |
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.
|
<T extends Annotation> |
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.
|
<T extends Annotation> |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public MethodList(Class<?> c)
all methods
available
on the class.
The synthetic methods
and methods declared directly
on the Object
class are filtered out.c
- class from which the method list is created.public MethodList(Class<?> c, boolean declaredMethods)
all methods
available
on the class or declared methods
only,
depending on the value of the declaredMethods
parameter.
The synthetic methods
and methods declared directly
on the Object
class are filtered out.c
- 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.public MethodList(Collection<Method> methods)
synthetic methods
and methods declared directly
on the Object
class are filtered out.methods
- methods to be included in the method list.public MethodList(Method... methods)
synthetic methods
and methods declared directly
on the Object
class are filtered out.methods
- methods to be included in the method list.public MethodList(AnnotatedMethod... methods)
annotated methods
.methods
- methods to be included in the method list.public Iterator<AnnotatedMethod> iterator()
annotated methods
contained
in this method list.iterator
in interface Iterable<AnnotatedMethod>
public MethodList isNotPublic()
public MethodList hasNumParams(int paramCount)
paramCount
- number of method parameters.public MethodList hasReturnType(Class<?> returnType)
returnType
- method return type.public MethodList nameStartsWith(String prefix)
prefix
- method name prefix.public <T extends Annotation> MethodList withAnnotation(Class<T> annotation)
T
- annotation type.annotation
- annotation class.public <T extends Annotation> MethodList withMetaAnnotation(Class<T> annotation)
T
- meta-annotation type.annotation
- meta-annotation class.public <T extends Annotation> MethodList withoutAnnotation(Class<T> annotation)
T
- annotation type.annotation
- annotation class.public <T extends Annotation> MethodList withoutMetaAnnotation(Class<T> annotation)
T
- meta-annotation type.annotation
- meta-annotation class.public MethodList filter(MethodList.Filter filter)
method list filter
.filter
- method list filter.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.