public abstract class MethodLiteral<T,M extends Member & AnnotatedElement & GenericDeclaration> extends MemberLiteral<T,M>
TypeLiteral
Modifier | Constructor and Description |
---|---|
protected |
MethodLiteral(M member,
TypeLiteral<T> declaringType) |
Modifier and Type | Method and Description |
---|---|
static <T> MethodLiteral<T,Constructor<?>> |
get(Constructor<?> constructor,
TypeLiteral<T> declaringType)
Creates a new
MethodLiteral based on the passed constructor and
its declaring type. |
static <T> MethodLiteral<T,Method> |
get(Method method,
TypeLiteral<T> declaringType)
Creates a new
MethodLiteral based on the passed method and its
declaring type. |
List<TypeLiteral<?>> |
getExceptionTypes()
Returns this method's exception types, if appropriate parametrized with
the declaring class's type parameters.
|
protected abstract Annotation[][] |
getParameterAnnotations() |
List<Key<?>> |
getParameterKeys()
Returns this method's parameter keys, if appropriate parametrized with the
declaring class's type parameters.
|
List<TypeLiteral<?>> |
getParameterTypes()
Returns this method's parameter types, if appropriate parametrized with
the declaring class's type parameters.
|
abstract List<Type> |
getRawParameterTypes()
Returns this method's parameter types without any type parametrization
applied.
|
abstract TypeLiteral<?> |
getReturnType()
Returns this method's return type, if appropriate parametrized with the
declaring class's type parameters.
|
TypeVariable<?>[] |
getTypeParameters()
Returns this method's type parameters.
|
abstract boolean |
isConstructor()
Returns
true if this method literal is based on a constructor. |
String |
toString()
Returns the method's declaring type and name in the format used in
javadoc, e.g.
|
getAnnotation, getAnnotations, getBindingAnnotation, getBindingAnnotation, getDeclaringType, getMember, getModifiers, getName, getRawDeclaringType, isAnnotationPresent, isDefaultAccess, isPrivate, isPublic, isStatic
protected MethodLiteral(M member, TypeLiteral<T> declaringType)
public static <T> MethodLiteral<T,Method> get(Method method, TypeLiteral<T> declaringType)
MethodLiteral
based on the passed method and its
declaring type.method
- method for which the literal is constructeddeclaringType
- type declaring the passed methodpublic static <T> MethodLiteral<T,Constructor<?>> get(Constructor<?> constructor, TypeLiteral<T> declaringType)
MethodLiteral
based on the passed constructor and
its declaring type.constructor
- constructor for which the literal is constructeddeclaringType
- type declaring the constructorpublic List<Key<?>> getParameterKeys()
public List<TypeLiteral<?>> getParameterTypes()
public abstract List<Type> getRawParameterTypes()
<T> void foo(T t)
will return a list with a single
entry, a TypeVariable
with name T
and bounded by
java.lang.Object
.public List<TypeLiteral<?>> getExceptionTypes()
public TypeVariable<?>[] getTypeParameters()
public abstract TypeLiteral<?> getReturnType()
public abstract boolean isConstructor()
true
if this method literal is based on a constructor.protected abstract Annotation[][] getParameterAnnotations()
public String toString()
com.bar.Foo#baz(com.bar.Foo, com.bar.Bar)
, with
resolved type parameters.Copyright © 2008–2018. All rights reserved.