本文整理匯總了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);
}
}
}