Package com.evolveum.midpoint.prism.impl
Class PrismValueImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
- All Implemented Interfaces:
- Freezable,- ItemDefinitionTransformer.TransformableValue,- MidpointOriginMetadata,- PathVisitable,- PrismContextSensitive,- PrismValue,- Revivable,- Visitable,- DebugDumpable,- Serializable
- Direct Known Subclasses:
- PrismContainerValueImpl,- PrismPropertyValueImpl,- PrismReferenceValueImpl
public abstract class PrismValueImpl
extends AbstractFreezable
implements PrismValue, ItemDefinitionTransformer.TransformableValue
- Author:
- semancik
- See Also:
- 
Field SummaryFieldsFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidprotected voidappendOriginDump(StringBuilder builder) voidapplyDefinition(ItemDefinition definition) voidapplyDefinition(ItemDefinition definition, boolean force) abstract voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) voidUsed when we are removing the value from the previous parent.abstract PrismValueclone()Literal clone.abstract PrismValuecloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.protected voidcopyValues(CloneStrategy strategy, PrismValueImpl clone) Collection<? extends ItemDelta>diff(PrismValue otherValue, ParameterizedEquivalenceStrategy strategy) Assumes matching representations.final voiddiffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy) booleandiffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff) booleanequals(PrismValue otherValue, @NotNull EquivalenceStrategy equivalenceStrategy) booleanequals(PrismValue other, @NotNull ParameterizedEquivalenceStrategy strategy) boolean@NotNull Collection<Item<?,?>> getAllItems(@NotNull ItemPath path) @NotNull Collection<PrismValue>getAllValues(ItemPath path) protected ItemDefinition@NotNull ItemPathgetPath()protected Objectabstract @Nullable Class<?>abstract <T> TReturns the statically-typed "real value".@NotNull PrismValuegetUserData(@NotNull String key) @NotNull ValueMetadataMaybe it is better to expect empty value metadata if these are absent.inthashCode()inthashCode(@NotNull EquivalenceStrategy equivalenceStrategy) inthashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) booleanbooleanvoidCurrently doing nothing.protected voidvoidRecompute the value or otherwise "initialize" it before adding it to a prism tree.abstract voidrecompute(PrismContext prismContext) booleanrepresentsSameValue(PrismValue other, boolean lax) Returns true if this and other value represent the same value.voidrevive(PrismContext prismContext) TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)voidsetOriginObject(Objectable source) voidsetOriginType(OriginType type) voidvoidsetPrismContext(PrismContext prismContext) voidsetTransient(boolean value) voidsetUserData(@NotNull String key, Object value) voidsetValueMetadata(Containerable realValue) Sets metadata from this value (from PCV).voidsetValueMetadata(PrismContainer<?> valueMetadataContainer) Sets metadata for this value.voidsetValueMetadata(ValueMetadata valueMetadata) Sets metadata for this value.abstract StringMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezablefreeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutableMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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.ItemDefinitionTransformer.TransformableValuetransformDefinitionMethods inherited from interface com.evolveum.midpoint.prism.PrismValuecloneIfImmutable, find, getNearestValueOfType, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getValueMetadataAsContainer, hasRealClass, isEmpty, isObjectable, isOfType, isRaw, valueMetadata
- 
Field Details- 
defaultEquivalenceStrategy
 
- 
- 
Method Details- 
setPrismContext- Specified by:
- setPrismContextin interface- PrismValue
 
- 
setOriginObject- Specified by:
- setOriginObjectin interface- MidpointOriginMetadata
 
- 
setOriginType- Specified by:
- setOriginTypein interface- MidpointOriginMetadata
 
- 
getOriginType- Specified by:
- getOriginTypein interface- MidpointOriginMetadata
 
- 
getOriginObject- Specified by:
- getOriginObjectin interface- MidpointOriginMetadata
 
- 
getUserData- Specified by:
- getUserDatain interface- PrismValue
 
- 
getUserData- Specified by:
- getUserDatain interface- PrismValue
 
- 
setUserData- Specified by:
- setUserDatain interface- PrismValue
 
- 
getParent- Specified by:
- getParentin interface- PrismValue
 
- 
setParent- Specified by:
- setParentin interface- PrismValue
 
- 
getPath- Specified by:
- getPathin interface- PrismValue
 
- 
getPathComponent
- 
clearParentpublic void clearParent()Used when we are removing the value from the previous parent. Or when we know that the previous parent will be discarded and we want to avoid unnecessary cloning.- Specified by:
- clearParentin interface- PrismValue
 
- 
getPrismContext- Specified by:
- getPrismContextin interface- PrismContextSensitive
 
- 
getDefinition
- 
applyDefinition- Specified by:
- applyDefinitionin interface- PrismValue
- Throws:
- SchemaException
 
- 
applyDefinition- Specified by:
- applyDefinitionin interface- PrismValue
- Throws:
- SchemaException
 
- 
reviveDescription copied from interface:RevivableTODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)
- 
recomputepublic void recompute()Recompute the value or otherwise "initialize" it before adding it to a prism tree. This may as well do nothing if no recomputing or initialization is needed.- Specified by:
- recomputein interface- PrismValue
 
- 
recompute- Specified by:
- recomputein interface- PrismValue
 
- 
accept- Specified by:
- acceptin interface- PrismValue
- Specified by:
- acceptin interface- Visitable
 
- 
accept- Specified by:
- acceptin interface- PathVisitable
- Specified by:
- acceptin interface- PrismValue
 
- 
checkConsistenceInternalpublic abstract void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
- checkConsistenceInternalin interface- PrismValue
 
- 
representsSameValueDescription copied from interface:PrismValueReturns true if this and other value represent the same value. E.g. if they have the same IDs, OIDs or it is otherwise know that they "belong together" without a deep examination of the values.- Specified by:
- representsSameValuein interface- PrismValue
- lax- If we can reasonably assume that the two values belong together even if they don't have the same ID, e.g. if they both belong to single-valued parent items. This is useful e.g. when comparing multi-valued containers. But can cause problems when we want to be sure we are removing the correct value.
 
- 
normalizepublic void normalize()Description copied from interface:PrismValueCurrently doing nothing.- Specified by:
- normalizein interface- PrismValue
 
- 
cloneLiteral clone.- Specified by:
- clonein interface- PrismValue
- Overrides:
- clonein class- Object
 
- 
createImmutableClone- Specified by:
- createImmutableClonein interface- PrismValue
 
- 
cloneComplexComplex clone with different cloning strategies.- Specified by:
- cloneComplexin interface- PrismValue
- See Also:
 
- 
copyValues
- 
hashCodepublic int hashCode()
- 
hashCode- Specified by:
- hashCodein interface- PrismValue
 
- 
hashCode- Specified by:
- hashCodein interface- PrismValue
 
- 
equalspublic boolean equals(PrismValue otherValue, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy) - Specified by:
- equalsin interface- PrismValue
 
- 
equalspublic boolean equals(PrismValue other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy) - Specified by:
- equalsin interface- PrismValue
 
- 
equals
- 
diffpublic Collection<? extends ItemDelta> diff(PrismValue otherValue, ParameterizedEquivalenceStrategy strategy) Assumes matching representations. I.e. it assumes that both this and otherValue represent the same instance of item. E.g. the container with the same ID.- Specified by:
- diffin interface- PrismValue
 
- 
diffMatchingRepresentationpublic final void diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy) 
- 
diffMatchingRepresentationpublic boolean diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff) 
- 
appendOriginDump
- 
toHumanReadableString- Specified by:
- toHumanReadableStringin interface- PrismValue
 
- 
getRealClass- Specified by:
- getRealClassin interface- PrismValue
 
- 
getRealValue@Nullable public abstract <T> T getRealValue()Description copied from interface:PrismValueReturns the statically-typed "real value". TODO specify when exactly the returned value can be null. TODO decide for containers: they throw an exception if the value is not statically typed.- Specified by:
- getRealValuein interface- PrismValue
 
- 
getRootValue- Specified by:
- getRootValuein interface- PrismValue
 
- 
getParentContainerValue- Specified by:
- getParentContainerValuein interface- PrismValue
 
- 
getTypeName- Specified by:
- getTypeNamein interface- PrismValue
 
- 
getAllValuesDescription copied from interface:PrismValue- Specified by:
- getAllValuesin interface- PrismValue
 
- 
getAllItemsDescription copied from interface:PrismValueSeeItem.getAllItems(ItemPath). Here the path is never empty.- Specified by:
- getAllItemsin interface- PrismValue
 
- 
getValueMetadataDescription copied from interface:PrismValueMaybe it is better to expect empty value metadata if these are absent. Client code would be simpler. HIGHLY EXPERIMENTAL.- Specified by:
- getValueMetadatain interface- PrismValue
 
- 
hasValueMetadatapublic boolean hasValueMetadata()- Specified by:
- hasValueMetadatain interface- PrismValue
- Returns:
- True if this value has any metadata (i.e. the metadata container has any value). TODO Or should we accept only non-empty values? Probably not.
 
- 
setValueMetadataDescription copied from interface:PrismValueSets metadata for this value.- Specified by:
- setValueMetadatain interface- PrismValue
 
- 
setValueMetadataDescription copied from interface:PrismValueSets metadata for this value.- Specified by:
- setValueMetadatain interface- PrismValue
 
- 
setValueMetadataDescription copied from interface:PrismValueSets metadata from this value (from PCV). To be removed (most probably).- Specified by:
- setValueMetadatain interface- PrismValue
- Throws:
- SchemaException
 
- 
performFreezeprotected void performFreeze()- Overrides:
- performFreezein class- AbstractFreezable
 
- 
isTransientpublic boolean isTransient()- Specified by:
- isTransientin interface- PrismValue
- Returns:
- True if the value is transient, so it won't be serialized if serialization of transient value is disabled.
 
- 
setTransientpublic void setTransient(boolean value) - Specified by:
- setTransientin interface- PrismValue
 
 
-