org.test4j.datafilling.filler
类 PoJoFiller
java.lang.Object
org.test4j.datafilling.Filler
org.test4j.datafilling.filler.PoJoFiller
- 直接已知子类:
- ConstructorFiller, FactoryMethodFiller, SetterMethodFiller
public class PoJoFiller
- extends Filler
PoJo对象填充器
- 作者:
- darui.wudr
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PoJoFiller
public PoJoFiller(DataFactory strategy,
Map<String,Type> argsTypeMap)
fillingPoJo
public <T> T fillingPoJo(AttributeInfo pojoAttr,
int depth)
throws PoJoFillException
- Generic method which returns an instance of the given class filled with
dummy values
- 参数:
pojoAttr - The generic type arguments for the current generic class
instancedepth - How many times dtoClass has been found
- 返回:
- An instance of filled with dummy values
- 抛出:
PoJoFillException - if a problem occurred while creating a POJO
instance or while setting its state
fillingWithConstructorsOrFactory
public Object fillingWithConstructorsOrFactory(AttributeInfo attrinbuteInfo)
throws Exception
- It attempts to create an instance of the given class
使用工厂方法创建实例对象
This method attempts to create an instance of the given argument for
classes without setters. These may be either immutable classes (e.g. with
final attributes and no setters) or Java classes (e.g. belonging to the
java / javax namespace).
In case the class does not provide a public, no-arg constructor (e.g.
Calendar), this method attempts to find a , no-args, factory method (e.g.
getInstance()) and it invokes it
- 参数:
clazz - The class for which a new instance is required
- 返回:
- An instance of the given class
- 抛出:
Exception
Copyright © 2013. All rights reserved.