Class MethodList
java.lang.Object
org.glassfish.jersey.server.model.MethodList
- All Implemented Interfaces:
Iterable<AnnotatedMethod>
Iterable list of methods on a single class with convenience getters for
additional method information.
- Author:
- Paul Sandoz, Marek Potociar
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMethodList(Class<?> c) Create new method list for a class.MethodList(Class<?> c, boolean declaredMethods) Create new method list for a class.MethodList(Method... methods) Create new method list from the given array of methods.MethodList(Collection<Method> methods) Create new method list from the given collection of methods.MethodList(AnnotatedMethod... methods) Create new method list from the given array ofannotated methods. -
Method Summary
Modifier and TypeMethodDescriptionfilter(MethodList.Filter filter) Created a new method list containing only the methods supported by themethod list filter.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.hasReturnType(Class<?> returnType) Get a new sub-list of methods containing all the methods from this method list that declare the specified return type.Get a new sub-list of methods containing all the methods from this method list that are not public.iterator()Iterator over the list ofannotated methodscontained in this method list.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>
MethodListwithAnnotation(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>
MethodListwithMetaAnnotation(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>
MethodListwithoutAnnotation(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>
MethodListwithoutMetaAnnotation(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MethodList
Create new method list for a class. The method list containsall methodsavailable on the class. Thesynthetic methodsand methods declared directly on theObjectclass are filtered out.- Parameters:
c- class from which the method list is created.
-
MethodList
Create new method list for a class. The method list containsall methodsavailable on the class ordeclared methodsonly, depending on the value of thedeclaredMethodsparameter. Thesynthetic methodsand methods declared directly on theObjectclass are filtered out.- Parameters:
c- class from which the method list is created.declaredMethods- iftrueonly thedeclared methodswill be included in the method list; otherwiseall methodswill be listed.
-
MethodList
Create new method list from the given collection of methods. Thesynthetic methodsand methods declared directly on theObjectclass are filtered out.- Parameters:
methods- methods to be included in the method list.
-
MethodList
Create new method list from the given array of methods. Thesynthetic methodsand methods declared directly on theObjectclass are filtered out.- Parameters:
methods- methods to be included in the method list.
-
MethodList
Create new method list from the given array ofannotated methods.- Parameters:
methods- methods to be included in the method list.
-
-
Method Details
-
iterator
Iterator over the list ofannotated methodscontained in this method list.- Specified by:
iteratorin interfaceIterable<AnnotatedMethod>- Returns:
- method list iterator.
-
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.
-
hasNumParams
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
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
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
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
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
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
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.
-
filter
Created a new method list containing only the methods supported by themethod list filter.- Parameters:
filter- method list filter.- Returns:
- new filtered method list.
-