public final class TargetType
extends java.lang.Object
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");
| Modifier and Type | Method and Description |
|---|---|
<T> Invoker<T> |
in(java.lang.Class<T> target)
Creates a new constructor invoker.
|
static TargetType |
startConstructorAccess()
Creates a new
TargetType. |
ParameterTypes |
withParameterTypes(java.lang.Class<?>... parameterTypes)
Specifies the parameter types for the constructor to invoke.
|
public static TargetType startConstructorAccess()
TargetType.TargetType.public <T> Invoker<T> in(java.lang.Class<T> target)
T - the generic type of the class containing the constructor to invoke.target - the the type of object that the constructor invoker will create.public ParameterTypes withParameterTypes(java.lang.Class<?>... parameterTypes)
parameterTypes - the types of the parameters to pass to the constructor.java.lang.NullPointerException - if the given array is null.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.