本文整理汇总了Java中de.invesdwin.util.bean.AValueObject类的典型用法代码示例。如果您正苦于以下问题:Java AValueObject类的具体用法?Java AValueObject怎么用?Java AValueObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AValueObject类属于de.invesdwin.util.bean包,在下文中一共展示了AValueObject类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyValue
import de.invesdwin.util.bean.AValueObject; //导入依赖的package包/类
private void copyValue(final IBeanPathElement thisElement, final Object valueThere) {
boolean copy = true;
final IPropertyBeanPathElement thisPropertyElement = (IPropertyBeanPathElement) thisElement;
final Object valueThis = thisPropertyElement.getModifier().getValue();
if (valueThis != null) {
if (valueThis instanceof AValueObject) {
final AValueObject vo = (AValueObject) valueThis;
if (recursionFilter.add(Objects.toStringIdentity(vo))) {
new ValueObjectMerge(vo, overwrite, clone, recursionFilter).merge(valueThere);
}
copy = clone;
} else {
copy = overwrite;
}
}
if (copy) {
final Class<?> type = thisPropertyElement.getModifier().getAccessor().getRawType().getType();
final Object convertedValue = convertValue(valueThere, type);
thisPropertyElement.getModifier().setValue(convertedValue);
}
}
示例2: ValueObjectMerge
import de.invesdwin.util.bean.AValueObject; //导入依赖的package包/类
public ValueObjectMerge(final AValueObject thisVo, final boolean overwrite, final boolean clone,
final Set<String> recursionFilter) {
this.thisVo = thisVo;
this.overwrite = overwrite;
this.clone = clone;
this.recursionFilter = recursionFilter;
}
示例3: merge
import de.invesdwin.util.bean.AValueObject; //导入依赖的package包/类
public void merge(final Object o) {
//CHECKSTYLE:ON
final BeanObjectContext thisCtx = new BeanObjectContext(thisVo);
boolean thisProcessed = false;
final BeanObjectContext thereCtx = new BeanObjectContext(o);
new BeanObjectProcessor(thereCtx).withShallowOnly().process();
for (final IBeanPathElement thereElement : thereCtx.getElementRegistry().getElements()) {
final String propertyName = thereElement.getAccessor().getBeanPathFragment();
if (!thereElement.isProperty() || !thereElement.getAccessor().hasPublicGetterOrField()) {
continue;
}
if (Objects.REFLECTION_EXCLUDED_FIELDS.contains(propertyName)) {
continue;
}
final IPropertyBeanPathElement therePropertyElement = (IPropertyBeanPathElement) thereElement;
Object valueThere = therePropertyElement.getModifier().getValue();
if (clone && valueThere != null) {
if (valueThere instanceof AValueObject) {
final AValueObject cValueThere = (AValueObject) valueThere;
valueThere = cValueThere.shallowClone();
} else /* if (valueThere instanceof Cloneable) */ {
try {
valueThere = Reflections.method("clone").in(valueThere).invoke();
} catch (final Throwable t) {
//ignore
}
}
}
if (valueThere != null) {
if (!thisProcessed) {
//process lazy
new BeanObjectProcessor(thisCtx).withShallowOnly().process();
thisProcessed = true;
}
final IBeanPathElement thisElement = thisCtx.getElementRegistry().getElement(propertyName);
if (thisElement == null || !thisElement.isProperty()
|| !thisElement.getAccessor().hasPublicSetterOrField()) {
continue;
}
copyValue(thisElement, valueThere);
}
}
}