|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.testng.internal.ClassHelper
public final class ClassHelper
Utility class for different class manipulations.
Method Summary | ||
---|---|---|
static java.lang.Object |
createInstance(java.lang.Class<?> declaringClass,
java.util.Map<java.lang.Class,IClass> classes,
XmlTest xmlTest,
IAnnotationFinder finder,
IObjectFactory objectFactory)
Create an instance for the given class. |
|
static IAnnotationFinder |
createJdkAnnotationFinder(IAnnotationTransformer annoTransformer)
|
|
static IMethodSelector |
createSelector(XmlMethodSelector selector)
|
|
static IJUnitTestRunner |
createTestRunner(TestRunner runner)
|
|
static java.lang.reflect.Method |
findFactoryMethod(java.lang.Class<?> cls,
IAnnotationFinder finder)
For the given class, returns the method annotated with @Factory or null if none is found. |
|
static java.lang.Class<?> |
forName(java.lang.String className)
Tries to load the specified class using the context ClassLoader or if none, than from the default ClassLoader. |
|
static java.util.Set<java.lang.reflect.Method> |
getAvailableMethods(java.lang.Class<?> clazz)
Extract all callable methods of a class and all its super (keeping in mind the Java access rules). |
|
static
|
newInstance(java.lang.Class<T> clazz)
|
|
static
|
tryOtherConstructor(java.lang.Class<T> declaringClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> T newInstance(java.lang.Class<T> clazz)
public static java.lang.Class<?> forName(java.lang.String className)
className
- the class name to be loaded.
public static java.lang.reflect.Method findFactoryMethod(java.lang.Class<?> cls, IAnnotationFinder finder)
cls
- The class to search for the @Factory annotation.finder
- The finder (JDK 1.4 or JDK 5.0+) use to search for the annotation.
method
or null
FIXME: @Factory method must be public!
TODO rename this method to findDeclaredFactoryMethodpublic static java.util.Set<java.lang.reflect.Method> getAvailableMethods(java.lang.Class<?> clazz)
clazz
-
public static IJUnitTestRunner createTestRunner(TestRunner runner)
runner
-
public static IAnnotationFinder createJdkAnnotationFinder(IAnnotationTransformer annoTransformer)
public static IMethodSelector createSelector(XmlMethodSelector selector)
public static java.lang.Object createInstance(java.lang.Class<?> declaringClass, java.util.Map<java.lang.Class,IClass> classes, XmlTest xmlTest, IAnnotationFinder finder, IObjectFactory objectFactory)
public static <T> T tryOtherConstructor(java.lang.Class<T> declaringClass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |