Java Apache Commons BeanUtils/PropertyUtils的反射:实例化路径中的空值

Java Apache Commons BeanUtils/PropertyUtils的反射:实例化路径中的空值,java,reflection,apache-commons-beanutils,Java,Reflection,Apache Commons Beanutils,我使用ApacheBeanutils/PropertyUtils通过反射获取/设置嵌套属性。但有时,树中的某个地方可能有一个空对象 e、 g 如果b为NULL,则查找Apache Commons的代码 if (nestedBean == null) { throw new NestedNullException ("Null property value for '" + name + "' on bean cl

我使用ApacheBeanutils/PropertyUtils通过反射获取/设置嵌套属性。但有时,树中的某个地方可能有一个空对象

e、 g

如果b为NULL,则查找Apache Commons的代码

if (nestedBean == null) {
         throw new NestedNullException
                ("Null property value for '" + name +
                 "' on bean class '" + bean.getClass() + "'");
}
我正在寻找的行为是实例化缺少的对象以填充空值。这种功能在任何地方都可用吗?这被称为“惰性路径”属性吗?

可能重复的副本可能重复的副本
if (nestedBean == null) {
         throw new NestedNullException
                ("Null property value for '" + name +
                 "' on bean class '" + bean.getClass() + "'");
}