public abstract class BaseDataBean extends java.lang.Object implements DataBean
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
BaseDataBean() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
<T extends BaseDataBean> |
deepClone() |
void |
fillData(java.util.Map<java.lang.String,java.lang.Object> map) |
void |
fillData(java.lang.Object obj) |
void |
fillData(java.lang.String fieldName,
java.lang.String value) |
void |
fillDataFromDB(java.lang.String query)
Column names in record returned by query must match bean property names.
|
void |
fillFromConfig(java.lang.String datakey)
Can be used with xml configuration file or properties file
|
void |
fillFromJsonString(java.lang.String jsonstr)
fill bean from json data.
|
void |
fillRandomData()
This will fill random data except those properties which has skip=true in
Randomizer annotation. |
java.lang.String |
getCSVLabel() |
protected java.lang.reflect.Field[] |
getFields()
returns all fields including from super class
|
static java.lang.String |
getRandomValue(java.lang.String... values) |
protected void |
setField(java.lang.reflect.Field field,
java.lang.String val) |
java.lang.String |
toCSV() |
java.lang.String |
toCSV(java.lang.String csvNames) |
java.lang.String |
toString() |
public void fillData(java.lang.Object obj)
protected java.lang.reflect.Field[] getFields()
public void fillFromJsonString(java.lang.String jsonstr)
jsonstr
- public void fillFromConfig(java.lang.String datakey)
datakey
- public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCSV(java.lang.String csvNames)
public java.lang.String getCSVLabel()
public void fillData(java.util.Map<java.lang.String,java.lang.Object> map)
public void fillDataFromDB(java.lang.String query)
query
- for example
select col1 as beanprop1, col2 as beanprop2 ...
from table
public void fillData(java.lang.String fieldName, java.lang.String value)
fieldName
- case insensitive field namevalue
- public void fillRandomData()
Randomizer
annotation. Use Randomizer
annotation to
specify data value to be generated for specific property.fillRandomData
in interface DataBean
Randomizer
protected void setField(java.lang.reflect.Field field, java.lang.String val)
public static java.lang.String getRandomValue(java.lang.String... values)
public java.lang.Object clone()
clone
in class java.lang.Object
public <T extends BaseDataBean> T deepClone()
Copyright © 2000 Infostretch Corp.