Class PrismContainerImpl<C extends Containerable>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.ItemImpl<PrismContainerValue<C>,PrismContainerDefinition<C>>
-
- com.evolveum.midpoint.prism.impl.PrismContainerImpl<C>
-
- All Implemented Interfaces:
Freezable
,Item<PrismContainerValue<C>,PrismContainerDefinition<C>>
,Itemable
,ItemDefinitionTransformer.TransformableItem
,ParentVisitable
,PathVisitable
,PrismContainer<C>
,PrismContainerable<C>
,PrismContextSensitive
,Revivable
,Visitable
,DebugDumpable
,Serializable
- Direct Known Subclasses:
PrismObjectImpl
,ResourceAttributeContainerImpl
public class PrismContainerImpl<C extends Containerable> extends ItemImpl<PrismContainerValue<C>,PrismContainerDefinition<C>> implements PrismContainer<C>
Property container groups properties into logical blocks.The reason for grouping may be as simple as better understandability of data structure. But the group usually means different meaning, source or structure of the data. For example, the property container is frequently used to hold properties that are dynamic, not fixed by a static schema. Such grouping also naturally translates to XML and helps to "quarantine" such properties to avoid Unique Particle Attribute problems.
Property Container contains a set of (potentially multi-valued) properties or inner property containers. The order of properties is not significant, regardless of the fact that it may be fixed in the XML representation. In the XML representation, each element inside Property Container must be either Property or a Property Container.
Property Container is mutable.
- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<C>
compileTimeClass
-
Fields inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
definition, elementName, incomplete, parent, values
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismContainerImpl(QName name)
PrismContainerImpl(QName name, PrismContainerDefinition<C> definition, PrismContext prismContext)
PrismContainerImpl(QName name, PrismContext prismContext)
PrismContainerImpl(QName name, Class<C> compileTimeClass)
PrismContainerImpl(QName name, Class<C> compileTimeClass, PrismContext prismContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor, ItemPath path, boolean recursive)
void
add(Item<?,?> item)
Convenience method.protected boolean
addInternal(@NotNull PrismContainerValue newValue, boolean checkEquivalents, EquivalenceStrategy strategy)
protected boolean
addInternalExecution(@NotNull PrismContainerValue<C> newValue)
void
applyDefinition(PrismContainerDefinition<C> definition)
void
assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier)
boolean
canRepresent(@NotNull Class<?> compileTimeClass)
Returns true if values of this container can be represented as specified compile-time class.boolean
canRepresent(@NotNull QName type)
Returns true if values of this container can be presented as specified type (from compile-time or runtime schema).void
checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
protected void
checkDefinition(PrismContainerDefinition<C> def)
PrismContainer<C>
clone()
Literal clone.PrismContainer<C>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.boolean
containsItem(ItemPath itemPath, boolean acceptEmptyItem)
protected void
copyValues(CloneStrategy strategy, PrismContainerImpl<C> clone)
ContainerDelta<C>
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.ContainerDelta<C>
createDelta(ItemPath path)
PrismContainer<C>
createImmutableClone()
PrismContainerValue<C>
createNewValue()
static <V extends PrismContainerValue>
voidcreateParentIfNeeded(V value, ItemDefinition definition)
String
debugDump(int indent)
PrismContainerDefinition<C>
deepCloneDefinition(@NotNull DeepCloneOperation operation)
ContainerDelta<C>
diff(PrismContainer<C> other)
ContainerDelta<C>
diff(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy)
List<? extends ItemDelta>
diffModifications(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy)
boolean
equivalent(Object obj)
This method ignores some part of the object during comparison (e.g.Object
find(ItemPath path)
Returns object (Item or PrismValue) pointed to by the given path.<T extends Containerable>
PrismContainer<T>findContainer(ItemPath path)
<T extends Containerable>
PrismContainer<T>findContainer(QName containerName)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindCreateItem(ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindCreateItem(QName itemQName, Class<I> type, boolean create)
<IV extends PrismValue,ID extends ItemDefinition<?>>
Item<IV,ID>findItem(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindItem(ItemPath path, Class<I> type)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindItem(QName itemQName, Class<I> type)
<T extends Containerable>
PrismContainer<T>findOrCreateContainer(ItemPath containerPath)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindOrCreateItem(ItemPath containerPath, Class<I> type)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindOrCreateItem(ItemPath containerPath, Class<I> type, ID definition)
<T> PrismProperty<T>
findOrCreateProperty(ItemPath propertyPath)
PrismReference
findOrCreateReference(ItemPath propertyPath)
<IV extends PrismValue,ID extends ItemDefinition<?>>
PartiallyResolvedItem<IV,ID>findPartial(ItemPath path)
<T> PrismProperty<T>
findProperty(ItemPath path)
PrismReference
findReference(ItemPath path)
PrismContainerValue<C>
findValue(long id)
@NotNull Collection<Item<?,?>>
getAllItems(@NotNull ItemPath path)
Returns all items corresponding to the provided path.@NotNull Collection<PrismValue>
getAllValues(ItemPath path)
Returns all values corresponding to the provided path.Class<C>
getCompileTimeClass()
Returns the static type of data represented by values of this container, if known and applicable.protected String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.PrismContainerDefinition<C>
getDefinition()
Returns applicable property container definition.<T> T
getPropertyRealValue(ItemPath propertyPath, Class<T> type)
C
getRealValue()
Returns the "real value" (content) of this item: - value contained in PrismPropertyValue - Referencable in PrismReferenceValue - Containerable in PrismContainerValue - Objectable in PrismObjectValue Note that the real value can contain operational items.@NotNull Collection<C>
getRealValues()
Returns (potentially empty) collection of "real values".@NotNull PrismContainerValue<C>
getValue()
Returns the value, if there is only one.PrismContainerValue<C>
getValue(Long id)
boolean
hasCompleteDefinition()
Returns true if the object and all contained prisms have definitions.boolean
isEmpty()
Normally the same asItem.hasNoValues()
.void
mergeValue(PrismContainerValue<C> otherValue)
void
mergeValues(PrismContainer<C> other)
void
mergeValues(Collection<PrismContainerValue<C>> otherValues)
protected void
propagateDeepCloneDefinition(@NotNull DeepCloneOperation operation, PrismContainerDefinition<C> clonedDef)
TODO descriptionvoid
remove(Item<?,?> item)
Convenience method.void
removeContainer(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
voidremoveItem(ItemPath path, Class<I> itemType)
void
removeProperty(ItemPath path)
void
removeReference(ItemPath path)
<X extends Containerable>
voidsetContainerRealValue(QName itemName, X realValue)
void
setDefinition(PrismContainerDefinition<C> definition)
Sets applicable property container definition.<T> void
setPropertyRealValue(QName propertyName, T realValue)
<T> void
setPropertyRealValues(QName propertyName, T... realValues)
void
setRealValue(C value)
void
setValue(@NotNull PrismContainerValue<C> value)
String
toString()
void
trim()
Remove all empty valuesvoid
trimDefinitionTree(Collection<? extends ItemPath> alwaysKeep)
Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container.-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, acceptParentVisitor, add, addAll, addForced, addIgnoringEquivalents, addRespectingMetadataAndCloning, appendDebugDumpSuffix, applyDefinition, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, clear, copyValues, diff, equals, equals, equals, fixupDelta, getElementName, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getRealValue, getRealValuesArray, getUserData, getUserData, getValues, hashCode, hashCode, hashCode, isIncomplete, merge, normalize, performFreeze, recomputeAllValues, remove, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, setElementName, setIncomplete, setParent, setPrismContext, setUserData, transformDefinition, valueRemoved
-
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
-
Methods inherited from interface com.evolveum.midpoint.prism.Item
acceptParentVisitor, add, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, applyDefinition, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, findValue, findValue, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, getValues, hasAnyValue, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setElementName, setIncomplete, setParent, setPrismContext, setUserData, size, valuesStream
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
-
-
-
Field Detail
-
compileTimeClass
protected Class<C extends Containerable> compileTimeClass
-
-
Constructor Detail
-
PrismContainerImpl
public PrismContainerImpl(QName name)
-
PrismContainerImpl
public PrismContainerImpl(QName name, PrismContext prismContext)
-
PrismContainerImpl
public PrismContainerImpl(QName name, Class<C> compileTimeClass, PrismContext prismContext)
-
PrismContainerImpl
public PrismContainerImpl(QName name, PrismContainerDefinition<C> definition, PrismContext prismContext)
-
-
Method Detail
-
getCompileTimeClass
public Class<C> getCompileTimeClass()
Description copied from interface:PrismContainer
Returns the static type of data represented by values of this container, if known and applicable. (There are containers that are purely dynamic, i.e. without any compile time class.)- Specified by:
getCompileTimeClass
in interfacePrismContainer<C extends Containerable>
- Specified by:
getCompileTimeClass
in interfacePrismContainerable<C extends Containerable>
-
canRepresent
public boolean canRepresent(@NotNull @NotNull Class<?> compileTimeClass)
Description copied from interface:PrismContainer
Returns true if values of this container can be represented as specified compile-time class. For example, PrismContainer of AbstractRoleType has: - canRepresent(AbstractRoleType.class) = true - canRepresent(FocusType.class) = true - canRepresent(ObjectType.class) = true - canRepresent(TaskType.class) = false - canRepresent(RoleType.class) = false- Specified by:
canRepresent
in interfacePrismContainer<C extends Containerable>
-
canRepresent
public boolean canRepresent(@NotNull @NotNull QName type)
Description copied from interface:PrismContainer
Returns true if values of this container can be presented as specified type (from compile-time or runtime schema). In particular, returns true if type of this container or any of its supertypes match given type.- Specified by:
canRepresent
in interfacePrismContainer<C extends Containerable>
-
getRealValues
@NotNull public @NotNull Collection<C> getRealValues()
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
getRealValues
in interfacePrismContainer<C extends Containerable>
- Returns:
- List of current values. The list itself is freely modifiable - it is independent on the list of values in this container. However, values themselves are directly linked to the PCVs.
-
getRealValue
@NotNull public C getRealValue()
Description copied from interface:Item
Returns the "real value" (content) of this item: - value contained in PrismPropertyValue - Referencable in PrismReferenceValue - Containerable in PrismContainerValue - Objectable in PrismObjectValue Note that the real value can contain operational items. It can also contain container IDs (although they are not considered to be part of the real value). It does not contain information about item element name nor other metadata like origin, definition, etc. (Although e.g. Containerable can be converted back into PrismContainerValue that can be used to retrieve this information.)- Specified by:
getRealValue
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
getRealValue
in interfacePrismContainer<C extends Containerable>
- Overrides:
getRealValue
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
setRealValue
public void setRealValue(C value) throws SchemaException
- Specified by:
setRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
getValue
@NotNull public @NotNull PrismContainerValue<C> getValue()
Description copied from interface:Item
Returns the value, if there is only one. Throws exception if there are more values. If there is no value, this method either: - returns null (for properties) - throws an exception (for items that can hold multiple values) - creates an empty value (for containers and references). TODO think again whether getOrCreateValue would not be better- Specified by:
getValue
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
getValue
in interfacePrismContainer<C extends Containerable>
- Overrides:
getValue
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
setValue
public void setValue(@NotNull @NotNull PrismContainerValue<C> value) throws SchemaException
- Specified by:
setValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
addInternal
protected boolean addInternal(@NotNull @NotNull PrismContainerValue newValue, boolean checkEquivalents, EquivalenceStrategy strategy) throws SchemaException
- Overrides:
addInternal
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Throws:
SchemaException
-
addInternalExecution
protected boolean addInternalExecution(@NotNull @NotNull PrismContainerValue<C> newValue)
- Overrides:
addInternalExecution
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
getValue
public PrismContainerValue<C> getValue(Long id)
- Specified by:
getValue
in interfacePrismContainer<C extends Containerable>
-
setPropertyRealValue
public <T> void setPropertyRealValue(QName propertyName, T realValue) throws SchemaException
- Specified by:
setPropertyRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
setContainerRealValue
public <X extends Containerable> void setContainerRealValue(QName itemName, X realValue) throws SchemaException
- Specified by:
setContainerRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
setPropertyRealValues
public <T> void setPropertyRealValues(QName propertyName, T... realValues) throws SchemaException
- Specified by:
setPropertyRealValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
getPropertyRealValue
public <T> T getPropertyRealValue(ItemPath propertyPath, Class<T> type)
- Specified by:
getPropertyRealValue
in interfacePrismContainer<C extends Containerable>
-
add
public void add(Item<?,?> item) throws SchemaException
Convenience method. Works only on single-valued containers.- Specified by:
add
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
createNewValue
public PrismContainerValue<C> createNewValue()
- Specified by:
createNewValue
in interfacePrismContainer<C extends Containerable>
-
mergeValues
public void mergeValues(PrismContainer<C> other) throws SchemaException
- Specified by:
mergeValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
mergeValues
public void mergeValues(Collection<PrismContainerValue<C>> otherValues) throws SchemaException
- Specified by:
mergeValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
mergeValue
public void mergeValue(PrismContainerValue<C> otherValue) throws SchemaException
- Specified by:
mergeValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
trim
public void trim()
Remove all empty values- Specified by:
trim
in interfacePrismContainer<C extends Containerable>
-
getDefinition
public PrismContainerDefinition<C> getDefinition()
Returns applicable property container definition.May return null if no definition is applicable or the definition is not know.
- Specified by:
getDefinition
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
getDefinition
in interfaceItemable
- Specified by:
getDefinition
in interfacePrismContainer<C extends Containerable>
- Specified by:
getDefinition
in interfacePrismContainerable<C extends Containerable>
- Overrides:
getDefinition
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Returns:
- applicable property container definition
-
setDefinition
public void setDefinition(PrismContainerDefinition<C> definition)
Sets applicable property container definition.- Specified by:
setDefinition
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
setDefinition
in interfacePrismContainer<C extends Containerable>
- Overrides:
setDefinition
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Parameters:
definition
- the definition to set
-
applyDefinition
public void applyDefinition(PrismContainerDefinition<C> definition) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
applyDefinition
in interfacePrismContainer<C extends Containerable>
- Overrides:
applyDefinition
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Throws:
SchemaException
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findItem(QName itemQName, Class<I> type)
- Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
Returns true if the object and all contained prisms have definitions.- Specified by:
hasCompleteDefinition
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
find
public Object find(ItemPath path)
Description copied from interface:Item
Returns object (Item or PrismValue) pointed to by the given path.- Specified by:
find
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
findPartial
in interfacePrismContainer<C extends Containerable>
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findCreateItem(QName itemQName, Class<I> type, boolean create) throws SchemaException
- Specified by:
findCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findItem(ItemPath path, Class<I> type)
- Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> findItem(ItemPath path)
- Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
containsItem
public boolean containsItem(ItemPath itemPath, boolean acceptEmptyItem) throws SchemaException
- Specified by:
containsItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findCreateItem(ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create) throws SchemaException
- Specified by:
findCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findValue
public PrismContainerValue<C> findValue(long id)
- Specified by:
findValue
in interfacePrismContainer<C extends Containerable>
-
findContainer
public <T extends Containerable> PrismContainer<T> findContainer(ItemPath path)
- Specified by:
findContainer
in interfacePrismContainer<C extends Containerable>
-
findContainer
public <T extends Containerable> PrismContainer<T> findContainer(QName containerName)
-
findProperty
public <T> PrismProperty<T> findProperty(ItemPath path)
- Specified by:
findProperty
in interfacePrismContainer<C extends Containerable>
-
findReference
public PrismReference findReference(ItemPath path)
- Specified by:
findReference
in interfacePrismContainer<C extends Containerable>
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type, ID definition) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateContainer
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath) throws SchemaException
- Specified by:
findOrCreateContainer
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateProperty
public <T> PrismProperty<T> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
- Specified by:
findOrCreateProperty
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateReference
public PrismReference findOrCreateReference(ItemPath propertyPath) throws SchemaException
- Specified by:
findOrCreateReference
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
remove
public void remove(Item<?,?> item)
Convenience method. Works only on single-valued containers.- Specified by:
remove
in interfacePrismContainer<C extends Containerable>
-
removeProperty
public void removeProperty(ItemPath path)
- Specified by:
removeProperty
in interfacePrismContainer<C extends Containerable>
-
removeContainer
public void removeContainer(ItemPath path)
- Specified by:
removeContainer
in interfacePrismContainer<C extends Containerable>
-
removeReference
public void removeReference(ItemPath path)
- Specified by:
removeReference
in interfacePrismContainer<C extends Containerable>
-
removeItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> void removeItem(ItemPath path, Class<I> itemType)
- Specified by:
removeItem
in interfacePrismContainer<C extends Containerable>
-
createDelta
public ContainerDelta<C> createDelta()
Description copied from interface:Item
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)- Specified by:
createDelta
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
createDelta
in interfacePrismContainer<C extends Containerable>
-
createDelta
public ContainerDelta<C> createDelta(ItemPath path)
- Specified by:
createDelta
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
createDelta
in interfacePrismContainer<C extends Containerable>
-
isEmpty
public boolean isEmpty()
Description copied from interface:Item
Normally the same asItem.hasNoValues()
. But a container is considered empty also if all its values (PCVs) are empty. This is a bit strange and should be revisited.- Specified by:
isEmpty
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
checkDefinition
protected void checkDefinition(PrismContainerDefinition<C> def)
- Specified by:
checkDefinition
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Overrides:
checkConsistenceInternal
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Overrides:
assertDefinitions
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Throws:
SchemaException
-
diff
public ContainerDelta<C> diff(PrismContainer<C> other)
- Specified by:
diff
in interfacePrismContainer<C extends Containerable>
-
diff
public ContainerDelta<C> diff(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diff
in interfacePrismContainer<C extends Containerable>
-
diffModifications
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diffModifications
in interfacePrismContainer<C extends Containerable>
-
clone
public PrismContainer<C> clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
clone
in interfacePrismContainer<C extends Containerable>
- Specified by:
clone
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
createImmutableClone
public PrismContainer<C> createImmutableClone()
- Specified by:
createImmutableClone
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
createImmutableClone
in interfacePrismContainer<C extends Containerable>
- Overrides:
createImmutableClone
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
cloneComplex
public PrismContainer<C> cloneComplex(CloneStrategy strategy)
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Specified by:
cloneComplex
in interfacePrismContainer<C extends Containerable>
- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismContainerImpl<C> clone)
-
deepCloneDefinition
public PrismContainerDefinition<C> deepCloneDefinition(@NotNull @NotNull DeepCloneOperation operation)
- Specified by:
deepCloneDefinition
in interfacePrismContainer<C extends Containerable>
-
propagateDeepCloneDefinition
protected void propagateDeepCloneDefinition(@NotNull @NotNull DeepCloneOperation operation, PrismContainerDefinition<C> clonedDef)
Description copied from class:ItemImpl
TODO description- Overrides:
propagateDeepCloneDefinition
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfacePathVisitable
- Specified by:
accept
in interfacePrismContainer<C extends Containerable>
- Overrides:
accept
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
equivalent
public boolean equivalent(Object obj)
This method ignores some part of the object during comparison (e.g. source demarcation in values) These methods compare the "meaningful" parts of the objects.- Specified by:
equivalent
in interfacePrismContainer<C extends Containerable>
-
toString
public String toString()
- Overrides:
toString
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
- Overrides:
debugDump
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
getDebugDumpClassName
protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.- Overrides:
getDebugDumpClassName
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
createParentIfNeeded
public static <V extends PrismContainerValue> void createParentIfNeeded(V value, ItemDefinition definition) throws SchemaException
- Throws:
SchemaException
-
trimDefinitionTree
public void trimDefinitionTree(Collection<? extends ItemPath> alwaysKeep)
Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container. Works recursively by sub-containers of this one. USE WITH CARE. Make sure the definitions are not shared by other objects!- Specified by:
trimDefinitionTree
in interfacePrismContainer<C extends Containerable>
-
getAllValues
@NotNull public @NotNull Collection<PrismValue> getAllValues(ItemPath path)
Description copied from interface:Item
Returns all values corresponding to the provided path. The path may contain ambiguous segments (e.g. `assignment/targetRef` when there are more assignments). Limitations: . The path can contain only name segments and the "identifier" (`#`) segment - at least for now. No ID segments. . There are no guarantees about duplicate values. They may or may not be present in the returned collections. . The caller should not modify the returned collection in any way. Note to implementors: Please take care about the performance of this method.- Specified by:
getAllValues
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Overrides:
getAllValues
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
getAllItems
@NotNull public @NotNull Collection<Item<?,?>> getAllItems(@NotNull @NotNull ItemPath path)
Description copied from interface:Item
Returns all items corresponding to the provided path. This is an analogue toItem.getAllValues(ItemPath)
. The only difference here is that `#` segment is not allowed, as it does not correspond to an item. (Shouldn't these methods be rather called findAllValues/findAllItems?)- Specified by:
getAllItems
in interfaceItem<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Overrides:
getAllItems
in classItemImpl<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
-