|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.datafilling.common.ClassFieldInfo
public class ClassFieldInfo
This class wraps fields and setters information about a given class
The purpose of this class is to work as a sort of cache which stores the list of declared fields and setter methods of a given class. These information will then be analysed to compose the list of setters which can be invoked to create the state of a given POJO.
| 构造方法摘要 | |
|---|---|
ClassFieldInfo(Set<String> classFields,
Set<Method> classSetters)
Full constructor |
|
| 方法摘要 | |
|---|---|
static String |
extractFieldNameFromSetterMethod(Method method)
Given a setter Method, it extracts the field name, according to
JavaBean standards
This method, given a setter method, it returns the corresponding
attribute name. |
Set<String> |
getClassFields()
|
static ClassFieldInfo |
getClassInfo(Class<?> clazz)
It returns a ClassFieldInfo object for the given class |
Set<Method> |
getClassSetters()
|
static Set<String> |
getDeclaredInstanceFields(Class<?> clazz)
Given a class, it returns a Set of its declared instance field names. |
static Set<Method> |
getPojoSetters(Class<?> clazz,
Set<String> classFields)
Given a class and a set of class declared fields it returns a Set of setters matching the declared fields If present, a setter method is considered if and only if the classFields argument contains an attribute whose name matches the
setter, according to JavaBean standards. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ClassFieldInfo(Set<String> classFields,
Set<Method> classSetters)
className - The class nameclassFields - The set of fields belonging to this classclassSetters - The set of setters belonging to this class| 方法详细信息 |
|---|
public Set<Method> getClassSetters()
public Set<String> getClassFields()
public static ClassFieldInfo getClassInfo(Class<?> clazz)
ClassFieldInfo object for the given class
clazz - The class to retrieve info from
ClassFieldInfo object for the given classpublic static Set<String> getDeclaredInstanceFields(Class<?> clazz)
clazz - The class to analyse to retrieve declared fields
public static Set<Method> getPojoSetters(Class<?> clazz,
Set<String> classFields)
If present, a setter method is considered if and only if the
classFields argument contains an attribute whose name matches the
setter, according to JavaBean standards.
clazz - The class to analyse for settersclassFields - A Set of field names for which setters are to be found
public static String extractFieldNameFromSetterMethod(Method method)
Method, it extracts the field name, according to
JavaBean standards
This method, given a setter method, it returns the corresponding attribute name. For example: given setIntField the method would return intField. The correctness of the return value depends on the adherence to JavaBean standards.
method - The setter method from which the field name is required
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||