private boolean sourcesChanged() { for (Source<?,?> source: sources) { if (source.getDelta() != null) { return true; } } return false; }
public void mediumDump(StringBuilder sb) { sb.append("Source ").append(PrettyPrinter.prettyPrint(name)).append(":\n"); sb.append(" old: ").append(getItemOld()).append("\n"); sb.append(" delta: ").append(getDelta()).append("\n"); sb.append(" new: ").append(getItemNew()); }
@Override public void shortDump(StringBuilder sb) { sb.append(PrettyPrinter.prettyPrint(name)).append(": old=").append(getItemOld()).append(", delta=").append(getDelta()).append(", new=").append(getItemNew()); }
@Override public String debugDump(int indent) { StringBuilder sb = new StringBuilder(); DebugUtil.indentDebugDump(sb, indent); sb.append("Source ").append(PrettyPrinter.prettyPrint(name)); sb.append("\n"); DebugUtil.debugDumpWithLabel(sb, "old", getItemOld(), indent +1); sb.append("\n"); DebugUtil.debugDumpWithLabel(sb, "delta", getDelta(), indent +1); sb.append("\n"); DebugUtil.debugDumpWithLabel(sb, "new", getItemNew(), indent +1); return sb.toString(); }
@Override public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException { Source<V,D> source; if (context.getSources().isEmpty()) { throw new ExpressionEvaluationException("asIs evaluator cannot work without a source in "+ context.getContextDescription()); } if (context.getSources().size() > 1) { Source<V,D> defaultSource = (Source<V,D>) context.getDefaultSource(); if (defaultSource != null) { source = defaultSource; } else { throw new ExpressionEvaluationException("asIs evaluator cannot work with more than one source ("+ context.getSources().size() +" sources specified) without specification of a default source, in "+ context.getContextDescription()); } } else { source = (Source<V,D>) context.getSources().iterator().next(); } PrismValueDeltaSetTriple<V> sourceTriple = ItemDeltaUtil.toDeltaSetTriple(source.getItemOld(), source.getDelta(), prismContext); if (sourceTriple == null) { return null; } return ExpressionUtil.toOutputTriple(sourceTriple, outputDefinition, context.getAdditionalConvertor(), source.getResidualPath(), protector, prismContext); }
ItemDelta<?,?> delta = source.getDelta(); if (delta != null) { sourceTriple.merge((DeltaSetTriple) delta.toDeltaSetTriple((Item) source.getItemOld()));