use of org.eclipse.scout.rt.shared.servicetunnel.internal.AbstractHolderArgumentVisitor in project scout.rt by eclipse.
the class ServiceUtility method filterHolderArguments.
/**
* Holders and nvpairs need to be copied as value clones. A smartfield for example is a holder and must not go to
* backend. NVPairs with holder values ae replaced by NVPair with serializable holder arguments
*/
public Object[] filterHolderArguments(Object[] callerArgs) {
Object[] serializableArgs = new Object[callerArgs.length];
new AbstractHolderArgumentVisitor() {
@SuppressWarnings("unchecked")
@Override
public void visitHolder(IHolder input, IHolder output) {
if (!HolderUtility.containEqualValues(output, input)) {
output.setValue(input.getValue());
}
}
@Override
public void visitOther(Object[] input, Object[] output, int index) {
output[index] = input[index];
}
}.startVisiting(callerArgs, serializableArgs, 1, true);
return serializableArgs;
}
use of org.eclipse.scout.rt.shared.servicetunnel.internal.AbstractHolderArgumentVisitor in project scout.rt by eclipse.
the class ServiceUtility method extractHolderArguments.
/**
* Extract holders and nvpairs in callerArgs (and eventually in sub-arrays)
*/
public Object[] extractHolderArguments(Object[] callerArgs) {
Object[] holderArgs = new Object[callerArgs.length];
new AbstractHolderArgumentVisitor() {
@Override
public void visitHolder(IHolder input, IHolder output) {
// do nothing
}
@Override
public void visitOther(Object[] input, Object[] output, int index) {
// do nothing
}
}.startVisiting(callerArgs, holderArgs, 1, true);
return holderArgs;
}
Aggregations