private void applyDefinitionSet(Collection<V> set, ItemDefinition itemDefinition, boolean force) throws SchemaException { if (set == null) { return; } for (V val: set) { val.applyDefinition(itemDefinition, force); } }
private void applyDefinition(Collection<V> set, ItemDefinition itemDefinition) throws SchemaException { if (set == null) { return; } for (V item: set) { item.applyDefinition(itemDefinition); } }
public void applyDefinition(D definition) throws SchemaException { checkMutability(); this.definition = definition; if (getValuesToAdd() != null) { for (V pval : getValuesToAdd()) { pval.applyDefinition(definition); } } if (getValuesToDelete() != null) { for (V pval : getValuesToDelete()) { pval.applyDefinition(definition); } } if (getValuesToReplace() != null) { for (V pval : getValuesToReplace()) { pval.applyDefinition(definition); } } }
public void applyDefinition(D definition, boolean force) throws SchemaException { checkMutability(); // TODO consider if there is real change if (definition != null) { checkDefinition(definition); } if (this.prismContext == null && definition != null) { this.prismContext = definition.getPrismContext(); } this.definition = definition; for (PrismValue pval: getValues()) { pval.applyDefinition(definition, force); } }
public boolean add(@NotNull V newValue, boolean checkUniqueness, @NotNull EquivalenceStrategy equivalenceStrategy) throws SchemaException { checkMutability(); if (newValue.getPrismContext() == null) { newValue.setPrismContext(prismContext); } Itemable originalParent = newValue.getParent(); newValue.setParent(this); // needed e.g. because of PrismReferenceValue comparisons if (checkUniqueness && contains(newValue, equivalenceStrategy)) { newValue.setParent(originalParent); return false; } D definition = getDefinition(); if (definition != null) { if (!values.isEmpty() && definition.isSingleValue()) { throw new SchemaException("Attempt to put more than one value to single-valued item " + this + "; newly added value: " + newValue); } newValue.applyDefinition(definition, false); } return values.add(newValue); }