Package org.aoju.bus.core.beans
Class BeanPath
java.lang.Object
org.aoju.bus.core.beans.BeanPath
- All Implemented Interfaces:
Serializable
Bean路径表达式,用于获取多层嵌套Bean中的字段值或Bean对象 根据给定的表达式,查找Bean中对应的属性值对象 表达式分为两种:
- .表达式,可以获取Bean对象中的属性(字段)值或者Map中key对应的值
- []表达式,可以获取集合等对象中对应index的值
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取Bean中对应表达式的值获取表达式解析后的分段列表static BeanPath解析Bean路径表达式为Bean模式 Bean表达式,用于获取多层嵌套Bean中的字段值或Bean对象 根据给定的表达式,查找Bean中对应的属性值对象 表达式分为两种: .表达式,可以获取Bean对象中的属性(字段)值或者Map中key对应的值 []表达式,可以获取集合等对象中对应index的值void设置表达式指定位置(或filed对应)的值
若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
注意:toString()
-
Field Details
-
patternParts
-
-
Constructor Details
-
BeanPath
-
-
Method Details
-
of
解析Bean路径表达式为Bean模式 Bean表达式,用于获取多层嵌套Bean中的字段值或Bean对象 根据给定的表达式,查找Bean中对应的属性值对象 表达式分为两种:- .表达式,可以获取Bean对象中的属性(字段)值或者Map中key对应的值
- []表达式,可以获取集合等对象中对应index的值
表达式栗子:
persion persion.name persons[3] person.friends[5].name ['person']['friends'][5]['name']
- Parameters:
expression- 表达式- Returns:
BeanPath
-
getPatternParts
-
get
-
set
-
toString
-