|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.tools.reflector.PropertyAccessor
public class PropertyAccessor
POJO属性值或Map访问
| 构造方法摘要 | |
|---|---|
PropertyAccessor()
|
|
| 方法摘要 | |
|---|---|
static Object[][] |
getArrayItemProperties(Object arr,
String[] properties)
获得数组(集合)中各个对象的多个属性值 |
static List<?> |
getArrayItemProperty(Object arr,
String property)
获得数组(集合)中各个对象的属性值列表 |
static Collection |
getArrayOrItemProperty(Object item,
String property)
获得对象的属性列表 o 如果对象是集合或数组,返回集合对象的属性值的列表 o 如果对象是单值,且属性是集合或数组,直接返回单值对象的属性值 o 如果对象是单值,且属性是非集合和数组类型,构造包含这个属性值的列表 |
static List<List> |
getPropertiesOfList(List list,
String[] properties,
boolean throwNoProperty)
获得集合列表中对象的属性值列表 |
static List |
getPropertiesOfPoJo(Object target,
String[] properties,
boolean throwNoProperty)
获得PoJo对象或Map对象的属性值列表 |
static Object |
getProperty(Object o,
String prop)
* o 先根据get方法访问对象的属性,如果存在则返回 o 再根据is方法方法对象的属性,且方法值是bool型,返回 o 否则,直接方法对象的字段 o 如果对象是Map,则根据key值取 |
static Object |
getPropertyByOgnl(Object target,
String ognl)
|
static Object |
getPropertyByOgnl(Object object,
String ognl,
boolean throwNoProperty)
获得单值对象(非集合或数组,但包含Map)的单个属性值 先访问get方法(is方法),如果没有get方法再直接访问属性值 |
static List |
getPropertyOfList(List list,
String ognl,
boolean throwNoProperty)
|
static List<List> |
getPropertySetsOfList(List list,
String[] properties,
boolean throwNoProperty)
获得属性值列表的集合 |
static Object[] |
getPropertyValue(Object object,
String[] ognls,
boolean throwException)
获得单值对象(非集合或数组,但包含Map)的多个属性值 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public PropertyAccessor()
| 方法详细信息 |
|---|
public static Object getPropertyByOgnl(Object target,
String ognl)
public static Object getPropertyByOgnl(Object object,
String ognl,
boolean throwNoProperty)
object - ognlExpression - throwException -
public static Object getProperty(Object o,
String prop)
o - prop -
public static Object[] getPropertyValue(Object object,
String[] ognls,
boolean throwException)
object - ognl - throwException -
public static List<?> getArrayItemProperty(Object arr,
String property)
arr - 数组或集合,如果是单值(或Map)转为size=1的集合处理property -
public static Collection getArrayOrItemProperty(Object item,
String property)
item - property -
public static Object[][] getArrayItemProperties(Object arr,
String[] properties)
arr - 数组或集合,如果是单值(或Map)转为size=1的集合处理properties -
public static List<List> getPropertiesOfList(List list,
String[] properties,
boolean throwNoProperty)
list - properties - throwNoProperty -
public static List<List> getPropertySetsOfList(List list,
String[] properties,
boolean throwNoProperty)
list - properties - throwNoProperty -
public static List getPropertyOfList(List list,
String ognl,
boolean throwNoProperty)
public static List getPropertiesOfPoJo(Object target,
String[] properties,
boolean throwNoProperty)
target - properties - throwNoProperty -
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||