public abstract class MethodUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
checkParameters(ExecutableElement elem,
TypeUtils.TypeMatcher... paramTypeMatchers) |
static boolean |
checkSignature(ExecutableElement elem,
TypeUtils.TypeMatcher returnTypeMatcher,
TypeUtils.TypeMatcher... paramTypeMatchers) |
static List<ParameterInfo> |
getInfosFromParamList(List<? extends VariableElement> veList,
boolean varArgs)
Turns a list of
VariableElement s into a ParameterInfo list. |
static List<ParameterInfo> |
getParameterInfos(ExecutableElement method)
Turns the parameter list of an
ExecutableElement into a list of ParameterInfo
objects. |
static boolean |
isObjectMethod(ExecutableElement method)
Checks whether the specified method is one of the methods declared by the
Object class. |
public static boolean isObjectMethod(ExecutableElement method)
Object
class.
Hence, the method returns true
if the specified method is one of
method
- the method to checkObject
, false otherwise.public static boolean checkSignature(ExecutableElement elem, TypeUtils.TypeMatcher returnTypeMatcher, TypeUtils.TypeMatcher... paramTypeMatchers)
public static boolean checkParameters(ExecutableElement elem, TypeUtils.TypeMatcher... paramTypeMatchers)
public static List<ParameterInfo> getInfosFromParamList(List<? extends VariableElement> veList, boolean varArgs) throws IllegalArgumentException
VariableElement
s into a ParameterInfo
list.veList
- the list of VariableElement
svarArgs
- whether this parameter list is of a varargs method.
If set to true
, the last parameter must have an array type and is interpreted
as a varargs parameterParameterInfo
objectsIllegalArgumentException
- if one of the following conditions is true:
veList
is null
veList
has a null
type or namevarArgs
is set to true
, but veList
is emptyvarArgs
is set to true
, but the type of the last element of veList
is not an array typepublic static List<ParameterInfo> getParameterInfos(ExecutableElement method)
ExecutableElement
into a list of ParameterInfo
objects.
This is a convenience method, equivalent to
fromParamList(method.getParameters(), method.isVarArgs())
method
- the method from which to retrieve the parameter listParameterInfo
objectsCopyright © 2013–2014. All rights reserved.