|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fest.reflect.type.TypeLoader
public final class TypeLoader
Understands loading a class dynamically using a specific .
ClassLoader
| Method Summary | ||
|---|---|---|
Class<?> |
load()
Loads the class with the name specified in this type, using this class' ClassLoader. |
|
|
loadAs(Class<T> type)
Loads the class with the name specified in this type, as the given type, using this class' ClassLoader. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Class<?> load()
ClassLoader.
Example:
Class<?> type =type("org.republic.Jedi").withClassLoader(myClassLoader).load();
ReflectionError - wrapping any error that occurred during class loading.public <T> Class<? extends T> loadAs(Class<T> type)
ClassLoader.
The following example shows how to use this method. Let's assume that we have the class Jedi that
extends the class Person:
Class<Person> type =type("org.republic.Jedi").withClassLoader(myClassLoader).loadAs(Person.class);
T - the generic type of the type.type - the given type.
NullPointerException - if the given type is null.
ReflectionError - wrapping any error that occurred during class loading.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||