|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.reflect.Reflection2
@Beta public class Reflection2
Utilities that allow access to Invokables with owner types.
| Constructor Summary | |
|---|---|
Reflection2()
|
|
| Method Summary | ||
|---|---|---|
static
|
constructor(Class<T> ownerType,
Class<?>... parameterTypes)
returns an Invokable object that reflects a constructor present in the TypeToken type. |
|
static
|
constructors(com.google.common.reflect.TypeToken<T> ownerType)
return all constructors present in the class as Invokables. |
|
static
|
method(Class<T> ownerType,
String name,
Class<?>... parameterTypes)
returns an Invokable object that reflects a method present in the TypeToken type. |
|
static
|
method(com.google.common.reflect.TypeToken<T> ownerType,
Method method)
returns an Invokable object that links the method to its owner. |
|
static
|
methods(Class<T> ownerType)
return all methods present in the class as Invokables. |
|
protected static List<Class<?>> |
toClasses(com.google.common.collect.ImmutableList<com.google.common.reflect.Parameter> params)
|
|
static
|
typeToken(Class<T> in)
gets a TypeToken for the given class. |
|
static
|
typeToken(Type in)
gets a TypeToken for the given type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Reflection2()
| Method Detail |
|---|
public static <T> com.google.common.reflect.TypeToken<T> typeToken(Type in)
TypeToken for the given type.
public static <T> com.google.common.reflect.TypeToken<T> typeToken(Class<T> in)
TypeToken for the given class.
public static <T> com.google.common.reflect.Invokable<T,T> constructor(Class<T> ownerType,
Class<?>... parameterTypes)
Invokable object that reflects a constructor present in the TypeToken type.
ownerType - corresponds to Invokable.getOwnerType()parameterTypes - corresponds to Constructor.getParameterTypes()
IllegalArgumentException - if the constructor doesn't exist or a security exception occurredpublic static <T> Collection<com.google.common.reflect.Invokable<T,T>> constructors(com.google.common.reflect.TypeToken<T> ownerType)
Invokables.
ownerType - corresponds to Invokable.getOwnerType()
public static <T,R> com.google.common.reflect.Invokable<T,R> method(com.google.common.reflect.TypeToken<T> ownerType,
Method method)
Invokable object that links the method to its owner.
ownerType - corresponds to Invokable.getOwnerType()method - present in ownerType
public static <T,R> com.google.common.reflect.Invokable<T,R> method(Class<T> ownerType,
String name,
Class<?>... parameterTypes)
Invokable object that reflects a method present in the TypeToken type.
If there are multiple methods of the same name and parameter list, returns the method in the nearest
ancestor with the most specific return type (see Class.getDeclaredMethod(java.lang.String, java.lang.Class>...)).
ownerType - corresponds to Invokable.getOwnerType()name - name of the method to be returnedparameterTypes - corresponds to Method.getParameterTypes()
IllegalArgumentException - if the method doesn't exist or a security exception occurredpublic static <T> Collection<com.google.common.reflect.Invokable<T,Object>> methods(Class<T> ownerType)
Invokables.
ownerType - corresponds to Invokable.getOwnerType()protected static List<Class<?>> toClasses(com.google.common.collect.ImmutableList<com.google.common.reflect.Parameter> params)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||