T - the class in which the constructor is declared.
The following is an example of proper usage of the classes in this package:
// Equivalent to call 'new Person()' Person p =constructor().in(Person.class).newInstance(); // Equivalent to call 'new Person("Yoda")' Person p =constructor().withParameterTypes(String.class).in(Person.class).newInstance("Yoda");
public final class Invoker<T>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
java.lang.reflect.Constructor<T> |
info()
Returns the "real" constructor managed by this class.
|
T |
newInstance(java.lang.Object... args)
Creates a new instance of
T by calling a constructor with the given arguments. |
static <T> Invoker<T> |
newInvoker(java.lang.Class<T> target,
java.lang.Class<?>... parameterTypes) |
public static <T> Invoker<T> newInvoker(java.lang.Class<T> target, java.lang.Class<?>... parameterTypes)
public T newInstance(java.lang.Object... args)
T by calling a constructor with the given arguments.args - the arguments to pass to the constructor (can be zero or more).T.ReflectionError - if a new instance cannot be created.public java.lang.reflect.Constructor<T> info()
Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.