public class DynaBeanValueProvider extends Object implements ValueProvider<String>
Constructor and Description |
---|
DynaBeanValueProvider(DynaBean dynaBean,
boolean ignoreError)
构造
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
是否包含指定KEY,如果不包含则忽略注入
此接口方法单独需要实现的意义在于:有些值提供者(比如Map)key是存在的,但是value为null,此时如果需要注入这个null,需要根据此方法判断 |
Object |
value(String key,
Type valueType)
获取值
返回值一般需要匹配被注入类型,如果不匹配会调用默认转换 Convert#convert(Type, Object)实现转换 |
public DynaBeanValueProvider(DynaBean dynaBean, boolean ignoreError)
dynaBean
- DynaBeanignoreError
- 是否忽略错误public Object value(String key, Type valueType)
ValueProvider
value
in interface ValueProvider<String>
key
- Bean对象中参数名valueType
- 被注入的值的类型public boolean containsKey(String key)
ValueProvider
containsKey
in interface ValueProvider<String>
key
- Bean对象中参数名Copyright © 2024. All rights reserved.