|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jtiger.assertion.Reflection
public final class Reflection
Provides the ability to make assertions on Java reflection types.
| Method Summary | |
|---|---|
static Constructor<?> |
assertHasConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class has a constructor with the given parameter types. |
static Constructor<?> |
assertHasDeclaredConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class has a declared constructor with the given parameter types. |
static Field |
assertHasDeclaredField(Class<?> c,
String name,
Object... message)
Asserts that the given class has a declared field with the given name. |
static Method |
assertHasDeclaredMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class has a declared method with the given name and parameter types. |
static Field |
assertHasField(Class<?> c,
String name,
Object... message)
Asserts that the given class has a field with the given name. |
static Method |
assertHasMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class has a method with the given name and parameter types. |
static void |
assertNotHasConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class does not have a constructor with the given parameter types. |
static void |
assertNotHasDeclaredConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class does not have a declared constructor with the given parameter types. |
static void |
assertNotHasDeclaredField(Class<?> c,
String name,
Object... message)
Asserts that the given class does not have a declared field with the given name. |
static void |
assertNotHasDeclaredMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class does not have a declared method with the given name and parameter types. |
static void |
assertNotHasField(Class<?> c,
String name,
Object... message)
Asserts that the given class does not have a field with the given name. |
static void |
assertNotHasMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
Asserts that the given class does not have a method with the given name and parameter types. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Constructor<?> assertHasConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert has the given constructor.parameterTypes - The parameter types of the constructor.message - The assertion message.
AssertionException - If the given class does not have a constructor with the given parameter types.Class.getConstructor(Class[])
public static void assertNotHasConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert does not have the given constructor.parameterTypes - The parameter types of the constructor.message - The assertion message.
AssertionException - If the given class has a constructor with the given parameter types.Class.getConstructor(Class[])
public static Constructor<?> assertHasDeclaredConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert has the given declared constructor.parameterTypes - The parameter types of the declared constructor.message - The assertion message.
AssertionException - If the given class does not have a declared constructor with the given parameter
types.Class.getDeclaredConstructor(Class[])
public static void assertNotHasDeclaredConstructor(Class<?> c,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert does not have the given declared constructor.parameterTypes - The parameter types of the declared constructor.message - The assertion message.
AssertionException - If the given class has a declared constructor with the given parameter
types.Class.getDeclaredConstructor(Class[])
public static Method assertHasMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert has the given method.name - The name of the method.parameterTypes - The parameter types of the method.message - The assertion message.
AssertionException - If the given class does not have a method with the given name and parameter types.Class.getMethod(String, Class[])
public static void assertNotHasMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert does not have the given method.name - The name of the method.parameterTypes - The parameter types of the method.message - The assertion message.
AssertionException - If the given class has a method with the given name and parameter types.Class.getMethod(String, Class[])
public static Method assertHasDeclaredMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert has the given method.name - The name of the method.parameterTypes - The parameter types of the method.message - The assertion message.
AssertionException - If the given class does not have a declared method with the given name and parameter
types.Class.getDeclaredMethod(String, Class[])
public static void assertNotHasDeclaredMethod(Class<?> c,
String name,
Class<?>[] parameterTypes,
Object... message)
throws AssertionException
c - The class to assert does not have the given method.name - The name of the method.parameterTypes - The parameter types of the method.message - The assertion message.
AssertionException - If the given class has a declared method with the given name and parameter types.Class.getDeclaredMethod(String, Class[])
public static Field assertHasField(Class<?> c,
String name,
Object... message)
throws AssertionException
c - The class to assert has the given field.name - The name of the field.message - The assertion message.
AssertionException - If the given class does not have a field with the given name.Class.getField(String)
public static void assertNotHasField(Class<?> c,
String name,
Object... message)
throws AssertionException
c - The class to assert does not have the given field.name - The name of the field.message - The assertion message.
AssertionException - If the given class has a field with the given name.Class.getField(String)
public static Field assertHasDeclaredField(Class<?> c,
String name,
Object... message)
throws AssertionException
c - The class to assert has the given field.name - The name of the field.message - The assertion message.
AssertionException - If the given class does not have a declared field with the given name.Class.getDeclaredField(String)
public static void assertNotHasDeclaredField(Class<?> c,
String name,
Object... message)
throws AssertionException
c - The class to assert does not have the given field.name - The name of the field.message - The assertion message.
AssertionException - If the given class has a declared field with the given name.Class.getDeclaredField(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||