public class JSONNodeBeanFactory extends Object implements NodeBeanFactory<JSON>
Constructor and Description |
---|
JSONNodeBeanFactory(JSONConfig config)
构造
|
Modifier and Type | Method and Description |
---|---|
JSON |
create(JSON parent,
BeanPath<JSON> beanPath)
创建Bean
beanPath对应当前的路径,即如果父对象为:a,则beanPath为:a.b,则创建的Bean为:a.b.c对应的Bean对象 给定的a一定存在,但是本路径中b对应的Bean不存在,则创建的对象是b的值,这个值用c表示 |
Object |
getValue(JSON bean,
BeanPath<JSON> beanPath)
获取Bean对应节点的值
|
JSON |
setValue(JSON bean,
Object value,
BeanPath<JSON> beanPath)
设置节点值
|
public JSONNodeBeanFactory(JSONConfig config)
config
- JSON配置public JSON create(JSON parent, BeanPath<JSON> beanPath)
NodeBeanFactory
create
in interface NodeBeanFactory<JSON>
parent
- 父BeanbeanPath
- 当前路径public Object getValue(JSON bean, BeanPath<JSON> beanPath)
NodeBeanFactory
getValue
in interface NodeBeanFactory<JSON>
bean
- bean对象beanPath
- 当前路径public JSON setValue(JSON bean, Object value, BeanPath<JSON> beanPath)
NodeBeanFactory
setValue
in interface NodeBeanFactory<JSON>
bean
- bean对象value
- 节点值beanPath
- 当前路径Copyright © 2025. All rights reserved.