Package org.testng.internal.objects
Class SimpleObjectDispenser
java.lang.Object
org.testng.internal.objects.SimpleObjectDispenser
- All Implemented Interfaces:
IObjectDispenser
A plain vanilla Object dispenser
-
Field Summary
FieldsFields inherited from interface org.testng.internal.objects.IObjectDispenser
GUICE_HELPER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Object
computeParameters
(Map<Class<?>, IClass> classes, Class<?> ec, ITestObjectFactory factory) (package private) static <T> T
createInstance
(Class<T> declaringClass, Map<Class<?>, IClass> classes, XmlTest xmlTest, IAnnotationFinder finder, ITestObjectFactory objectFactory, boolean create, String errorMsgPrefix) dispense
(CreationAttributes attributes) private static <T> Constructor
<T> findAnnotatedConstructor
(IAnnotationFinder finder, Class<T> declaringClass) Find the best constructor given the parameters found on the annotationprivate static <T> T
instantiateUsingDefaultConstructor
(Class<T> declaringClass, Map<Class<?>, IClass> classes, XmlTest xmlTest, ITestObjectFactory factory) private static <T> T
instantiateUsingParameterizedConstructor
(IAnnotationFinder finder, Constructor<T> constructor, XmlTest xmlTest, ITestObjectFactory objectFactory) void
setNextDispenser
(IObjectDispenser dispenser)
-
Field Details
-
objectFactory
-
-
Constructor Details
-
SimpleObjectDispenser
SimpleObjectDispenser(ITestObjectFactory objectFactory)
-
-
Method Details
-
setNextDispenser
- Specified by:
setNextDispenser
in interfaceIObjectDispenser
- Parameters:
dispenser
- - TheIObjectDispenser
to dispense
-
dispense
- Specified by:
dispense
in interfaceIObjectDispenser
-
createInstance
static <T> T createInstance(Class<T> declaringClass, Map<Class<?>, IClass> classes, XmlTest xmlTest, IAnnotationFinder finder, ITestObjectFactory objectFactory, boolean create, String errorMsgPrefix) -
instantiateUsingParameterizedConstructor
private static <T> T instantiateUsingParameterizedConstructor(IAnnotationFinder finder, Constructor<T> constructor, XmlTest xmlTest, ITestObjectFactory objectFactory) -
instantiateUsingDefaultConstructor
private static <T> T instantiateUsingDefaultConstructor(Class<T> declaringClass, Map<Class<?>, IClass> classes, XmlTest xmlTest, ITestObjectFactory factory) throws NoSuchMethodException- Throws:
NoSuchMethodException
-
computeParameters
private static Object computeParameters(Map<Class<?>, IClass> classes, Class<?> ec, ITestObjectFactory factory) throws NoSuchMethodException- Throws:
NoSuchMethodException
-
findAnnotatedConstructor
private static <T> Constructor<T> findAnnotatedConstructor(IAnnotationFinder finder, Class<T> declaringClass) Find the best constructor given the parameters found on the annotation
-