Package com.evolveum.midpoint.prism.impl
Class PrismReferenceImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.ItemImpl<PrismReferenceValue,PrismReferenceDefinition>
com.evolveum.midpoint.prism.impl.PrismReferenceImpl
- All Implemented Interfaces:
Freezable
,Item<PrismReferenceValue,
,PrismReferenceDefinition> Itemable
,ItemDefinitionTransformer.TransformableItem
,ParentVisitable
,PathVisitable
,PrismContextSensitive
,PrismReference
,Revivable
,Visitable
,DebugDumpable
,Serializable
public class PrismReferenceImpl
extends ItemImpl<PrismReferenceValue,PrismReferenceDefinition>
implements PrismReference
Object Reference is a property that describes reference to an object. It is
used to represent association between objects. For example reference from
User object to Account objects that belong to the user. The reference is a
simple uni-directional link using an OID as an identifier.
This type should be used for all object references so the implementations can
detect them and automatically resolve them.
- Author:
- semancik
- See Also:
-
Field Summary
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
ConstructorDescriptionPrismReferenceImpl
(QName name) PrismReferenceImpl
(QName name, PrismReferenceDefinition definition, PrismContext prismContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
clone()
Literal clone.cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.protected void
copyValues
(CloneStrategy strategy, PrismReferenceImpl clone) Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.createDelta
(ItemPath path) debugDump
(int indent) Returns object (Item or PrismValue) pointed to by the given path.<IV extends PrismValue,
ID extends ItemDefinition<?>>
PartiallyResolvedItem<IV,ID> findPartial
(ItemPath path) <I extends Item<?,
?>>
IfindReferencedItem
(ItemPath path, Class<I> type) Tries to find referenced path (path starting with object derefence) in-memory.findValueByOid
(String oid) protected String
Return a human readable name of this class suitable for logs.getOid()
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<Referencable>
Returns (potentially empty) collection of "real values".@NotNull PrismReferenceValue
getValue()
Returns the value, if there is only one.boolean
merge
(PrismReferenceValue value) toString()
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, accept, acceptParentVisitor, add, addAll, addForced, addIgnoringEquivalents, addInternal, addInternalExecution, addRespectingMetadataAndCloning, appendDebugDumpSuffix, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, copyValues, diff, equals, equals, equals, fixupDelta, getAllItems, getAllValues, getDefinition, getElementName, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getRealValue, getRealValuesArray, getUserData, getUserData, getValues, hashCode, hashCode, hashCode, isIncomplete, merge, normalize, performFreeze, propagateDeepCloneDefinition, recomputeAllValues, remove, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, setDefinition, 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, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, findValue, findValue, getAllItems, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDefinition, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, getValues, 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, setPrismContext, setUserData, size, valuesStream
Methods inherited from interface com.evolveum.midpoint.prism.PathVisitable
accept
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
Constructor Details
-
PrismReferenceImpl
-
PrismReferenceImpl
public PrismReferenceImpl(QName name, PrismReferenceDefinition definition, PrismContext prismContext)
-
-
Method Details
-
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<PrismReferenceValue,
PrismReferenceDefinition> - Overrides:
getValue
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
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<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
getRealValue
in interfacePrismReference
- Overrides:
getRealValue
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
getRealValues
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
getRealValues
in interfacePrismReference
-
merge
- Specified by:
merge
in interfacePrismReference
-
getOid
- Specified by:
getOid
in interfacePrismReference
-
getTargetName
- Specified by:
getTargetName
in interfacePrismReference
-
findValueByOid
- Specified by:
findValueByOid
in interfacePrismReference
-
find
Description copied from interface:Item
Returns object (Item or PrismValue) pointed to by the given path.- Specified by:
find
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) - Specified by:
findPartial
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
findPartial
in interfacePrismReference
-
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<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
createDelta
in interfacePrismReference
-
createDelta
- Specified by:
createDelta
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
createDelta
in interfacePrismReference
-
checkDefinition
- Specified by:
checkDefinition
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
clone
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
clone
in interfacePrismReference
- Specified by:
clone
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
createImmutableClone
- Specified by:
createImmutableClone
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
createImmutableClone
in interfacePrismReference
- Overrides:
createImmutableClone
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
cloneComplex
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismReferenceValue,
PrismReferenceDefinition> - Specified by:
cloneComplex
in interfacePrismReference
- See Also:
-
copyValues
-
toString
- Specified by:
toString
in interfacePrismReference
- Overrides:
toString
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
- Specified by:
debugDump
in interfacePrismReference
- Overrides:
debugDump
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
getDebugDumpClassName
Return a human readable name of this class suitable for logs.- Overrides:
getDebugDumpClassName
in classItemImpl<PrismReferenceValue,
PrismReferenceDefinition>
-
findReferencedItem
Description copied from interface:PrismReference
Tries to find referenced path (path starting with object derefence) in-memory. This works only for single-value references, whose value also contains embedded object. The search is performed on embedded object.- Specified by:
findReferencedItem
in interfacePrismReference
-