Interface PrismContainer<C extends Containerable>
- All Superinterfaces:
- Cloneable,- DebugDumpable,- Freezable,- Item<PrismContainerValue<C>,,- PrismContainerDefinition<C>> - Itemable,- ParentVisitable,- PathVisitable,- PrismContainerable<C>,- PrismVisitable,- Revivable,- Serializable,- Visitable
- All Known Subinterfaces:
- PrismObject<O>,- ShadowAssociationsContainer,- ShadowAttributesContainer,- ValueMetadata
- All Known Implementing Classes:
- DummyContainerImpl,- PrismContainerImpl,- PrismObjectImpl,- ShadowAssociation,- ShadowAssociationsContainerImpl,- ShadowAttributesContainerImpl,- ValueMetadataAdapter
Prism container groups items 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 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.
Container contains a set of (potentially multi-valued) properties, references, or inner 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 the container must be either property, reference, or a container.
A container is mutable.
- Author:
- Radovan Semancik
- 
Field SummaryFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRINGFields inherited from interface com.evolveum.midpoint.prism.ItemKEY_NAMESPACE_CONTEXT
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidConvenience method.booleancanRepresent(@NotNull Class<?> compileTimeClass) Returns true if values of this container can be represented as specified compile-time class.booleancanRepresent(QName type) Returns true if values of this container can be presented as specified type (from compile-time or runtime schema).clone()Literal clone.cloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.booleancontainsItem(ItemPath itemPath, boolean acceptEmptyItem) Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.createDelta(ItemPath path) static <V extends PrismContainerValue>
 voidcreateParentIfNeeded(V value, ItemDefinition definition) deepCloneDefinition(@NotNull DeepCloneOperation operation) diff(PrismContainer<C> other) diff(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) diffModifications(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) booleanequivalent(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.<T extends Containerable>
 PrismContainer<T>findContainer(ItemPath path) <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) Deprecated.<IV extends PrismValue,ID extends ItemDefinition<?>> 
 Item<IV,ID> <IV extends PrismValue,ID extends ItemDefinition<?>, I extends Item<IV, ID>> 
 I<IV extends PrismValue,ID extends ItemDefinition<?>, I extends Item<IV, ID>> 
 IDeprecated.<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) findOrCreateReference(ItemPath propertyPath) <IV extends PrismValue,ID extends ItemDefinition<?>> 
 PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) <T> PrismProperty<T>findProperty(ItemPath path) findReference(ItemPath path) findValue(long id) Returns the static type of data represented by values of this container, if known and applicable.Returns applicable definition.<T> TgetPropertyRealValue(ItemPath propertyPath, Class<T> type) 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>Returns (potentially empty) collection of "real values".@NotNull PrismContainerValue<C>getValue()Returns the value, if there is only one.@NotNull List<PrismContainerValue<C>>Returns the values for this item.voidmergeValue(PrismContainerValue<C> otherValue) voidmergeValues(PrismContainer<C> other) voidmergeValues(Collection<PrismContainerValue<C>> otherValues) static <V extends Containerable>
 PrismContainer<V>newInstance(PrismContext prismContext, QName type) voidConvenience method.voidremoveContainer(ItemPath path) <IV extends PrismValue,ID extends ItemDefinition<?>, I extends Item<IV, ID>> 
 voidremoveItem(ItemPath path, Class<I> itemType) voidremoveProperty(ItemPath path) voidremoveReference(ItemPath path) <C extends Containerable>
 voidsetContainerRealValue(QName containerName, C realValue) <T> voidsetPropertyRealValue(QName propertyName, T realValue) <T> voidsetPropertyRealValues(QName propertyName, T... realValues) voidsetRealValue(C value) voidsetValue(@NotNull PrismContainerValue<C> value) voidtrim()Remove all empty valuesvoidtrimDefinitionTree(Collection<? extends ItemPath> alwaysKeep) Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container.Methods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.FreezablecheckImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.ItemacceptParentVisitor, acceptVisitor, add, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, applyDefinition, applyDefinition, applyDefinitionIfMissing, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, find, findValue, findValue, getAllItems, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getNamespaceContext, getParent, getPath, getRealValue, getRealValues, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setDefinition, setElementName, setIncomplete, setParent, setUserData, size, valuesStreamMethods inherited from interface com.evolveum.midpoint.prism.PrismContainerablegetComplexTypeDefinition
- 
Method Details- 
getDefinitionPrismContainerDefinition<C> getDefinition()Description copied from interface:ItemReturns applicable definition.May return null if no definition is applicable or the definition is not known. - Specified by:
- getDefinitionin interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
- Specified by:
- getDefinitionin interface- Itemable
- Specified by:
- getDefinitionin interface- PrismContainerable<C extends Containerable>
- Returns:
- applicable definition
 
- 
getCompileTimeClassReturns 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:
- getCompileTimeClassin interface- PrismContainerable<C extends Containerable>
 
- 
canRepresentReturns 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
- 
canRepresentReturns 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.
- 
getRealValuesDescription copied from interface:ItemReturns (potentially empty) collection of "real values". The list itself is detached, freely modifiable. (Note that the values can still embed a parent, e.g., for containers and references.)- Specified by:
- getRealValuesin interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<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.
- See Also:
 
- 
getRealValueDescription copied from interface:ItemReturns 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:
- getRealValuein interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
setRealValue- Throws:
- SchemaException
 
- 
setValue- Throws:
- SchemaException
 
- 
getValueDescription copied from interface:ItemReturns 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:
- getValuein interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
getValue
- 
getValuesDescription copied from interface:ItemReturns the values for this item. Although the ordering of this values is not important, and each value should be present at most once, we currently return them as a list instead of a set. TODO reconsider this FIXME we should return immutable list, to avoid manipulating the values directly FIXME and maybe we should return List<? extends V> to avoid specializing the values, see ShadowAssociationValue in midPoint- Specified by:
- getValuesin interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
setPropertyRealValue- Throws:
- SchemaException
 
- 
setContainerRealValue<C extends Containerable> void setContainerRealValue(QName containerName, C realValue) throws SchemaException - Throws:
- SchemaException
 
- 
setPropertyRealValues- Throws:
- SchemaException
 
- 
getPropertyRealValue
- 
addConvenience method. Works only on single-valued containers.- Throws:
- SchemaException
 
- 
createNewValuePrismContainerValue<C> createNewValue()
- 
mergeValues- Throws:
- SchemaException
 
- 
mergeValues- Throws:
- SchemaException
 
- 
mergeValue- Throws:
- SchemaException
 
- 
trimvoid trim()Remove all empty values
- 
findItem@Deprecated <IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (QName itemQName, Class<I> type) Deprecated.
- 
findPartial<IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) - Specified by:
- findPartialin interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
findCreateItem@Deprecated <IV extends PrismValue,ID extends ItemDefinition<?>, I findCreateItemI extends Item<IV, ID>> (QName itemQName, Class<I> type, boolean create) throws SchemaException Deprecated.- Throws:
- SchemaException
 
- 
findItem<IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (ItemPath path, Class<I> type) 
- 
findItem
- 
containsItem- Throws:
- SchemaException
 
- 
findCreateItem<IV extends PrismValue,ID extends ItemDefinition<?>, I findCreateItemI extends Item<IV, ID>> (ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create) throws SchemaException - Throws:
- SchemaException
 
- 
findValue
- 
findContainer
- 
findProperty
- 
findReference
- 
findOrCreateItem<IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (ItemPath containerPath, Class<I> type) throws SchemaException - Throws:
- SchemaException
 
- 
findOrCreateItem<IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (ItemPath containerPath, Class<I> type, ID definition) throws SchemaException - Throws:
- SchemaException
 
- 
findOrCreateContainer<T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath) throws SchemaException - Throws:
- SchemaException
 
- 
findOrCreateProperty- Throws:
- SchemaException
 
- 
findOrCreateReference- Throws:
- SchemaException
 
- 
removeConvenience method. Works only on single-valued containers.
- 
removeProperty
- 
removeContainer
- 
removeReference
- 
removeItem<IV extends PrismValue,ID extends ItemDefinition<?>, void removeItemI extends Item<IV, ID>> (ItemPath path, Class<I> itemType) 
- 
createDeltaContainerDelta<C> createDelta()Description copied from interface:ItemCreates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)- Specified by:
- createDeltain interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
createDelta- Specified by:
- createDeltain interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
diff
- 
diff
- 
diffModificationsList<? extends ItemDelta> diffModifications(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) 
- 
clonePrismContainer<C> clone()Description copied from interface:ItemLiteral clone.- Specified by:
- clonein interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
createImmutableClonePrismContainer<C> createImmutableClone()- Specified by:
- createImmutableClonein interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
 
- 
cloneComplexDescription copied from interface:ItemComplex clone with different cloning strategies.- Specified by:
- cloneComplexin interface- Item<PrismContainerValue<C extends Containerable>,- PrismContainerDefinition<C extends Containerable>> 
- See Also:
 
- 
deepCloneDefinition
- 
accept- Specified by:
- acceptin interface- PathVisitable
 
- 
equivalentThis method ignores some part of the object during comparison (e.g. source demarcation in values) These methods compare the "meaningful" parts of the objects.
- 
newInstancestatic <V extends Containerable> PrismContainer<V> newInstance(PrismContext prismContext, QName type) throws SchemaException - Throws:
- SchemaException
 
- 
createParentIfNeededstatic <V extends PrismContainerValue> void createParentIfNeeded(V value, ItemDefinition definition) throws SchemaException - Throws:
- SchemaException
 
- 
trimDefinitionTreeOptimizes (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!
 
-