private void acceptSet(Collection<V> set, Visitor visitor) { if (set == null) { return; } for (V val: set) { val.accept(visitor); } }
public static void normalizeAllRelations(PrismValue value, RelationRegistry relationRegistry) { if (value != null) { value.accept(createNormalizingVisitor(relationRegistry)); } }
private void acceptSet(Collection<V> set, Long id, Visitor visitor, ItemPath rest, boolean recursive) { if (set == null) { return; } for (V pval : set) { if (pval instanceof PrismContainerValue<?>) { PrismContainerValue<?> cval = (PrismContainerValue<?>)pval; if (id == null || id.equals(cval.getId())) { pval.accept(visitor, rest, recursive); } } else { throw new IllegalArgumentException("Attempt to fit container id to "+pval.getClass()); } } }
static void applyVisitorToValues(Collection<? extends PrismValue> values, ItemDelta<?,?> delta, Visitor visitor) { Collection<? extends PrismValue> valuesToDelete = delta.getValuesToDelete(); if (valuesToDelete == null) { valuesToDelete = new ArrayList<>(0); // just to simplify the code below } if (values != null) { for (PrismValue pval : values) { boolean isToBeDeleted = valuesToDelete.contains(pval); pval.accept(visitor); if (!isToBeDeleted && valuesToDelete.contains(pval)) { // value becomes 'to be deleted' -> we remove it from toBeDeleted list delta.removeValueToDelete(pval); } } } }
@Override public void accept(Visitor visitor) { visitor.visit(this); for (PrismValue value: getValues()) { value.accept(visitor); } }
public void accept(Visitor visitor, boolean includeOldValues) { visitor.visit(this); if (getValuesToAdd() != null) { for (V pval : getValuesToAdd()) { pval.accept(visitor); } } if (getValuesToDelete() != null) { for (V pval : getValuesToDelete()) { pval.accept(visitor); } } if (getValuesToReplace() != null) { for (V pval : getValuesToReplace()) { pval.accept(visitor); } } if (includeOldValues && getEstimatedOldValues() != null) { for (V pval : getEstimatedOldValues()) { pval.accept(visitor); } } }