|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectReflection
public final class Reflection extends Object
Utility methods that operate on reflection objects (classes, methods, etc.).
| Modifier and Type | Class and Description |
|---|---|
static class |
Reflection.Match
Used by methods that that a java.lang.Class> object as argument and use it to compute something based on it. |
| Modifier and Type | Field and Description |
|---|---|
static long |
num_times_canBeUsedAs_called
|
static Comparator<Member> |
SORT_MEMBERS_BY_NAME
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canBePassedAsArgument(Object inputObject,
Class<?> parameterType)
Returns whether the input can be used as argument for the specified parameter type. |
static boolean |
canBeUsedAs(Class<?> c1,
Class<?> c2)
Checks if an object of class c1 can be used as an object of class c2. |
static String |
checkArgumentTypes(Object[] inputs,
Class<?>[] paramTypes,
Object errMsgContext)
Checks whether the inputs can be used as arguments for the specified parameter types. |
static ArrayList<Class<?>> |
classesForNames(ArrayList<String> l)
|
static Class<?> |
classForName(String classname)
Gets the class corresponding to the given string. |
static Class<?> |
classForName(String classname,
boolean noerr)
Gets the class corresponding to the given string. |
static String |
getCompilableName(Class<?> cls)
Returns a name that can be used in Java source for the given class. |
static Constructor<?> |
getConstructorForSignature(String s)
|
static Constructor<?>[] |
getConstructorsOrdered(Class<?> c)
Like Class.getConstructors(), but guarantees always same order. |
static Constructor<?>[] |
getDeclaredConstructorsOrdered(Class<?> c)
Like Class.getDeclaredConstructors(), but guarantees always same order. |
static Method[] |
getDeclaredMethodsOrdered(Class<?> c)
Like Class.getDeclaredMethods(), but guarantees always same order. |
static Set<Class<?>> |
getDirectSuperTypes(Class<?> c)
|
static Method |
getMethodForSignature(String s)
|
static Method[] |
getMethodsOrdered(Class<?> c)
Like Class.getMethods(), but guarantees always same order. |
static ArrayList<String> |
getNamesForClasses(ArrayList<Class<?>> cl)
To deserialize a list serialized with this method, use the method deserializeClassList. |
static String |
getSignature(Constructor<?> c)
|
static String |
getSignature(Method m)
|
static List<StatementKind> |
getStatements(Collection<Class<?>> classListing,
ReflectionFilter filter)
|
static boolean |
isAbstract(Class<?> c)
|
static boolean |
isVisible(Class<?> c)
|
static boolean |
isVisible(int modifiers)
Returns true if the the specified modifier is visible to Randoop. |
static List<Class<?>> |
loadClassesFromFile(File classListingFile)
Blank lines and lines starting with "#" are ignored. |
static List<Class<?>> |
loadClassesFromFile(File classListingFile,
boolean noerr)
Blank lines and lines starting with "#" are ignored. |
static List<Class<?>> |
loadClassesFromList(List<String> classNames,
boolean noerr)
Returns a list of classes, given a list of class names. |
static List<Class<?>> |
loadClassesFromReader(BufferedReader reader,
String filename)
Blank lines and lines starting with "#" are ignored. |
static List<Class<?>> |
loadClassesFromReader(BufferedReader reader,
String filename,
boolean noerr)
Blank lines and lines starting with "#" are ignored. |
static List<Class<?>> |
loadClassesFromStream(InputStream in,
String filename)
Blank lines and lines starting with "#" are ignored. |
static List<Member> |
loadMethodsAndCtorsFromFile(File classListingFile)
Blank lines and lines starting with "#" are ignored. |
static List<Member> |
loadMethodsAndCtorsFromLines(List<String> lines)
Blank lines and lines starting with "#" are ignored. |
static List<Member> |
loadMethodsAndCtorsFromReader(BufferedReader reader)
Blank lines and lines starting with "#" are ignored. |
static List<Member> |
loadMethodsAndCtorsFromStream(InputStream in)
Blank lines and lines starting with "#" are ignored. |
static Set<Class<?>> |
relatedClasses(Class<?> clazz,
int depth)
Returns the set of classes that appear, recursively, in the interface of the given class, to a given depth. |
static Set<Class<?>> |
relatedClasses(Collection<Class<?>> classes,
int i)
|
static void |
saveClassesToFile(List<Class<?>> classes,
String file)
|
static Method |
super_get_declared_method(Class<?> c,
String methodname,
Class<?>... parameter_types)
Looks for the specified method name in the specified class and all of its superclasses |
static StackTraceElement |
throwPointForName(String s)
|
static String |
throwPointToString(StackTraceElement throwPoint)
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<Member> SORT_MEMBERS_BY_NAME
public static long num_times_canBeUsedAs_called
| Method Detail |
|---|
public static Set<Class<?>> relatedClasses(Class<?> clazz,
int depth)
public static Set<Class<?>> relatedClasses(Collection<Class<?>> classes,
int i)
public static Method[] getMethodsOrdered(Class<?> c)
public static Method[] getDeclaredMethodsOrdered(Class<?> c)
public static Constructor<?>[] getConstructorsOrdered(Class<?> c)
public static Constructor<?>[] getDeclaredConstructorsOrdered(Class<?> c)
public static Class<?> classForName(String classname)
public static Class<?> classForName(String classname,
boolean noerr)
public static Set<Class<?>> getDirectSuperTypes(Class<?> c)
public static boolean canBeUsedAs(Class<?> c1,
Class<?> c2)
public static String checkArgumentTypes(Object[] inputs,
Class<?>[] paramTypes,
Object errMsgContext)
public static boolean canBePassedAsArgument(Object inputObject,
Class<?> parameterType)
public static List<Class<?>> loadClassesFromList(List<String> classNames,
boolean noerr)
public static List<Class<?>> loadClassesFromStream(InputStream in,
String filename)
public static List<Class<?>> loadClassesFromReader(BufferedReader reader,
String filename)
public static List<Class<?>> loadClassesFromReader(BufferedReader reader,
String filename,
boolean noerr)
public static List<Class<?>> loadClassesFromFile(File classListingFile)
throws IOException
IOException
public static List<Class<?>> loadClassesFromFile(File classListingFile,
boolean noerr)
throws IOException
IOExceptionpublic static List<Member> loadMethodsAndCtorsFromStream(InputStream in)
public static List<Member> loadMethodsAndCtorsFromReader(BufferedReader reader)
public static List<Member> loadMethodsAndCtorsFromLines(List<String> lines)
public static List<Member> loadMethodsAndCtorsFromFile(File classListingFile)
throws IOException
IOExceptionpublic static boolean isVisible(Class<?> c)
public static boolean isAbstract(Class<?> c)
public static void saveClassesToFile(List<Class<?>> classes,
String file)
throws IOException
IOException
public static List<StatementKind> getStatements(Collection<Class<?>> classListing,
ReflectionFilter filter)
classListing - filter - can be null.public static ArrayList<String> getNamesForClasses(ArrayList<Class<?>> cl)
IOExceptionpublic static ArrayList<Class<?>> classesForNames(ArrayList<String> l)
public static String getSignature(Constructor<?> c)
public static String getSignature(Method m)
public static Method getMethodForSignature(String s)
public static Constructor<?> getConstructorForSignature(String s)
public static String throwPointToString(StackTraceElement throwPoint)
public static StackTraceElement throwPointForName(String s)
public static String getCompilableName(Class<?> cls)
public static Method super_get_declared_method(Class<?> c,
String methodname,
Class<?>... parameter_types)
throws Exception
Exceptionpublic static boolean isVisible(int modifiers)
GenInputsAbstract.public_only
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||