public abstract class MethodLiteral<T,M extends java.lang.reflect.Member & java.lang.reflect.AnnotatedElement & java.lang.reflect.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,java.lang.reflect.Constructor<?>> |
get(java.lang.reflect.Constructor<?> constructor,
TypeLiteral<T> declaringType)
Creates a new
MethodLiteral based on the passed constructor and
its declaring type. |
static <T> MethodLiteral<T,java.lang.reflect.Method> |
get(java.lang.reflect.Method method,
TypeLiteral<T> declaringType)
Creates a new
MethodLiteral based on the passed method and its
declaring type. |
java.util.List<TypeLiteral<?>> |
getExceptionTypes()
Returns this method's exception types, if appropriate parametrized with
the declaring class's type parameters.
|
protected abstract java.lang.annotation.Annotation[][] |
getParameterAnnotations() |
java.util.List<Key<?>> |
getParameterKeys()
Returns this method's parameter keys, if appropriate parametrized with the
declaring class's type parameters.
|
java.util.List<TypeLiteral<?>> |
getParameterTypes()
Returns this method's parameter types, if appropriate parametrized with
the declaring class's type parameters.
|
abstract java.util.List<java.lang.reflect.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.
|
java.lang.reflect.TypeVariable<?>[] |
getTypeParameters()
Returns this method's type parameters.
|
abstract boolean |
isConstructor()
Returns
true if this method literal is based on a constructor. |
java.lang.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, isStaticprotected MethodLiteral(M member, TypeLiteral<T> declaringType)
public static <T> MethodLiteral<T,java.lang.reflect.Method> get(java.lang.reflect.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,java.lang.reflect.Constructor<?>> get(java.lang.reflect.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 java.util.List<Key<?>> getParameterKeys()
public java.util.List<TypeLiteral<?>> getParameterTypes()
public abstract java.util.List<java.lang.reflect.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 java.util.List<TypeLiteral<?>> getExceptionTypes()
public java.lang.reflect.TypeVariable<?>[] getTypeParameters()
public abstract TypeLiteral<?> getReturnType()
public abstract boolean isConstructor()
true if this method literal is based on a constructor.protected abstract java.lang.annotation.Annotation[][] getParameterAnnotations()
public java.lang.String toString()
com.bar.Foo#baz(com.bar.Foo, com.bar.Bar), with
resolved type parameters.toString in class java.lang.Object