|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.reflect.constructor.TargetType
public final class TargetType
Understands the type of object that the constructor will create.
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");
Method Summary | ||
---|---|---|
|
in(Class<T> target)
Creates a new constructor invoker. |
|
static TargetType |
startConstructorAccess()
Creates a new TargetType . |
|
ParameterTypes |
withParameterTypes(Class<?>... parameterTypes)
Specifies the parameter types for the constructor to invoke. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TargetType startConstructorAccess()
TargetType
.
TargetType
.public <T> Invoker<T> in(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(Class<?>... parameterTypes)
parameterTypes
- the types of the parameters to pass to the constructor.
NullPointerException
- if the given array is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |