public class PrismContainerValue<C extends Containerable> extends PrismValue implements DebugDumpable
Modifier and Type | Field and Description |
---|---|
protected ComplexTypeDefinition |
complexTypeDefinition |
protected List<Item<?,?>> |
items |
immutable, prismContext
INDENT_STRING
Constructor and Description |
---|
PrismContainerValue() |
PrismContainerValue(C containerable) |
PrismContainerValue(C containerable,
PrismContext prismContext) |
PrismContainerValue(OriginType type,
Objectable source,
PrismContainerable container,
Long id,
ComplexTypeDefinition complexTypeDefinition,
PrismContext prismContext) |
PrismContainerValue(PrismContext prismContext) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor) |
void |
accept(Visitor visitor,
ItemPath path,
boolean recursive) |
<IV extends PrismValue,ID extends ItemDefinition> |
add(Item<IV,ID> item) |
<IV extends PrismValue,ID extends ItemDefinition> |
add(Item<IV,ID> item,
boolean checkUniqueness)
Adds an item to a property container.
|
void |
addAll(Collection<? extends Item<?,?>> itemsToAdd)
Adds a collection of items to a property container.
|
void |
addAllReplaceExisting(Collection<? extends Item<?,?>> itemsToAdd)
Adds a collection of items to a property container.
|
boolean |
addRawElement(Object element) |
<IV extends PrismValue,ID extends ItemDefinition> |
addReplaceExisting(Item<IV,ID> item)
Adds an item to a property container.
|
void |
applyDefinition(ItemDefinition definition,
boolean force) |
void |
applyDefinition(PrismContainerDefinition<C> containerDef,
boolean force) |
C |
asContainerable() |
C |
asContainerable(Class<C> requiredClass) |
static <T extends Containerable> |
asContainerable(PrismContainerValue<T> value) |
static <C extends Containerable> |
asContainerables(Collection<PrismContainerValue<C>> pcvs) |
static <C extends Containerable> |
asContainerables(List<PrismContainerValue<C>> pcvs) |
static <C extends Containerable> |
asPrismContainerValues(List<C> containerables) |
void |
assertDefinitions(boolean tolerateRaw,
String sourceDescription) |
void |
assertDefinitions(String sourceDescription) |
PrismContainer<C> |
asSingleValuedContainer(QName itemName)
Returns a single-valued container (with a single-valued definition) holding just this value.
|
boolean |
canRepresent(Class<?> clazz) |
void |
checkConsistenceInternal(Itemable rootItem,
boolean requireDefinitions,
boolean prohibitRaw,
ConsistencyCheckScope scope) |
void |
clear() |
PrismContainerValue<C> |
clone()
Literal clone.
|
PrismContainerValue<C> |
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.
|
boolean |
contains(Item item) |
boolean |
contains(QName itemName) |
boolean |
containsItem(ItemPath propPath,
boolean acceptEmptyItem) |
static <C extends Containerable> |
containsRealValue(Collection<PrismContainerValue<C>> cvalCollection,
PrismContainerValue<C> cval) |
static void |
copyDefinition(Containerable aClone,
Containerable original,
PrismContext prismContext)
Deprecated.
|
protected void |
copyValues(CloneStrategy strategy,
PrismContainerValue<C> clone) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
createDetachedSubItem(QName name,
Class<I> type,
ID itemDefinition,
boolean immutable) |
<X> PrismProperty<X> |
createProperty(PrismPropertyDefinition propertyDefinition) |
<X> PrismProperty<X> |
createProperty(QName propertyName) |
String |
debugDump(int indent) |
protected void |
debugDumpIdentifiers(StringBuilder sb) |
protected void |
deepCloneDefinition(boolean ultraDeep,
PrismContainerDefinition<C> clonedContainerDef,
Consumer<ItemDefinition> postCloneAction) |
boolean |
deleteRawElement(Object element) |
protected void |
detailedDebugDumpStart(StringBuilder sb) |
boolean |
equals(Object obj) |
boolean |
equalsComplex(PrismContainerValue<?> other,
boolean ignoreMetadata,
boolean isLiteral) |
boolean |
equalsComplex(PrismValue other,
boolean ignoreMetadata,
boolean isLiteral) |
boolean |
equivalent(PrismContainerValue<?> other) |
Object |
find(ItemPath path) |
<X extends Containerable> |
findContainer(QName containerName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findItem(ItemDefinition itemDefinition,
Class<I> type) |
<IV extends PrismValue,ID extends ItemDefinition> |
findItem(ItemPath itemPath) |
<IV extends PrismValue,ID extends ItemDefinition> |
findItem(QName itemName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findItem(QName itemName,
Class<I> type) |
<IV extends PrismValue,ID extends ItemDefinition> |
findItem(String itemName) |
<T extends Containerable> |
findOrCreateContainer(QName containerName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findOrCreateItem(ItemPath path,
Class<I> type,
ID definition) |
<IV extends PrismValue,ID extends ItemDefinition> |
findOrCreateItem(QName containerName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findOrCreateItem(QName containerName,
Class<I> type) |
<X> PrismProperty<X> |
findOrCreateProperty(ItemPath propertyPath) |
<X> PrismProperty<X> |
findOrCreateProperty(PrismPropertyDefinition propertyDef) |
<X> PrismProperty<X> |
findOrCreateProperty(QName propertyQName) |
PrismReference |
findOrCreateReference(QName referenceName) |
<IV extends PrismValue,ID extends ItemDefinition> |
findPartial(ItemPath path) |
<X> PrismProperty<X> |
findProperty(ItemPath propertyPath) |
<X> PrismProperty<X> |
findProperty(PrismPropertyDefinition<X> propertyDefinition)
Finds a specific property in the container by definition.
|
<X> PrismProperty<X> |
findProperty(QName propertyQName) |
PrismReference |
findReference(QName elementName) |
PrismReference |
findReferenceByCompositeObjectElementName(QName elementName) |
Collection<PrismValue> |
getAllValues(ItemPath path) |
Class<C> |
getCompileTimeClass() |
ComplexTypeDefinition |
getComplexTypeDefinition() |
PrismContainer<C> |
getContainer() |
protected PrismContainerDefinition<C> |
getDefinition() |
Long |
getId() |
List<Item<?,?>> |
getItems()
Returns a set of items that the property container contains.
|
<I extends Item<?,?>> |
getItems(Class<I> type) |
Item<?,?> |
getNextItem(Item<?,?> referenceItem) |
PrismContainerable<C> |
getParent() |
ItemPath |
getPath()
Computes a path in current prism structure this value is part of.
|
Item<?,?> |
getPreviousItem(Item<?,?> referenceItem) |
PrismContext |
getPrismContext() |
PrismContext |
getPrismContextLocal() |
Set<PrismProperty<?>> |
getProperties()
Returns a set of properties that the property container contains.
|
Collection<QName> |
getPropertyNames() |
<T> T |
getPropertyRealValue(QName propertyName,
Class<T> type) |
Class<?> |
getRealClass() |
<T> T |
getRealValue() |
PrismContainerValue<?> |
getRootValue() |
QName |
getTypeName() |
C |
getValue() |
boolean |
hasCompleteDefinition() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isIdOnly() |
boolean |
isRaw()
Returns true if the value is raw.
|
void |
keepPaths(List<ItemPath> keep) |
boolean |
match(PrismValue otherValue) |
<IV extends PrismValue,ID extends ItemDefinition> |
merge(Item<IV,ID> item)
Merges the provided item into this item.
|
void |
mergeContent(PrismContainerValue<?> other,
List<QName> overwrite) |
void |
normalize() |
void |
recompute(PrismContext prismContext) |
<IV extends PrismValue,ID extends ItemDefinition> |
remove(Item<IV,ID> item) |
void |
removeAll() |
void |
removeContainer(ItemPath itemPath) |
void |
removeContainer(QName containerName) |
void |
removeItems(List<ItemPath> itemsToRemove) |
void |
removeOperationalItems() |
void |
removePaths(List<ItemPath> remove) |
void |
removeProperty(ItemPath propertyPath) |
void |
removeProperty(QName propertyName) |
boolean |
removeRawElement(Object element) |
void |
removeReference(ItemPath path) |
void |
removeReference(QName name) |
<IV extends PrismValue,ID extends ItemDefinition> |
replace(Item<IV,ID> oldItem,
Item<IV,ID> newItem) |
boolean |
representsSameValue(PrismValue other,
boolean lax)
Returns true if this and other value represent the same value.
|
void |
revive(PrismContext prismContext) |
void |
setId(Long id) |
void |
setImmutable(boolean immutable) |
void |
setOriginTypeRecursive(OriginType originType)
Set origin type to all values and subvalues
|
<T> void |
setPropertyRealValue(QName propertyName,
T realValue,
PrismContext prismContext) |
int |
size() |
<IV extends PrismValue,ID extends ItemDefinition> |
subtract(Item<IV,ID> item)
Subtract the provided item from this item.
|
String |
toHumanReadableString()
Returns a short (one-line) representation of the real value stored in this object.
|
static <T extends Containerable> |
toPcvList(List<T> beans) |
String |
toString() |
appendOriginDump, applyDefinition, checkMutability, clearParent, clearParent, cloneCollection, cloneCollectionComplex, cloneValues, collectionContainsEquivalentValue, contains, containsAll, containsRealValue, containsRealValue, copyValues, diff, diff, equals, equals, equalsRealValue, equalsRealValue, equalsRealValues, fromRealValue, getOriginObject, getOriginType, getParentContainerValue, getParentContainerValue, getRealValuesOfCollection, getUserData, getUserData, isImmutable, recompute, resetParentCollection, setOriginObject, setOriginType, setParent, setPrismContext, setUserData
finalize, getClass, notify, notifyAll, wait, wait, wait
debugDump, debugDumpLazily, debugDumpLazily
protected ComplexTypeDefinition complexTypeDefinition
public PrismContainerValue()
public PrismContainerValue(C containerable)
public PrismContainerValue(PrismContext prismContext)
public PrismContainerValue(C containerable, PrismContext prismContext)
public PrismContainerValue(OriginType type, Objectable source, PrismContainerable container, Long id, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
public static <T extends Containerable> T asContainerable(PrismContainerValue<T> value)
public PrismContext getPrismContext()
getPrismContext
in interface IPrismValue
getPrismContext
in class PrismValue
public PrismContext getPrismContextLocal()
public List<Item<?,?>> getItems()
The set may be null. In case there are no properties an empty set is returned.
Returned set is mutable. Live object is returned.
public int size()
public Set<PrismProperty<?>> getProperties()
The set must not be null. In case there are no properties an empty set is returned.
Returned set is immutable! Any change to it will be ignored.
public Long getId()
public void setId(Long id)
public PrismContainerable<C> getParent()
getParent
in interface IPrismValue
getParent
in class PrismValue
public PrismContainer<C> getContainer()
@NotNull public ItemPath getPath()
IPrismValue
getPath
in interface IPrismValue
getPath
in class PrismValue
public C getValue()
public C asContainerable()
public boolean canRepresent(Class<?> clazz)
public Collection<QName> getPropertyNames()
public <IV extends PrismValue,ID extends ItemDefinition> boolean add(Item<IV,ID> item) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition> boolean add(Item<IV,ID> item, boolean checkUniqueness) throws SchemaException
item
- item to add.SchemaException
IllegalArgumentException
- an attempt to add value that already existspublic <IV extends PrismValue,ID extends ItemDefinition> boolean merge(Item<IV,ID> item) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition> boolean subtract(Item<IV,ID> item) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition> void addReplaceExisting(Item<IV,ID> item) throws SchemaException
item
- item to add.SchemaException
public <IV extends PrismValue,ID extends ItemDefinition> void remove(Item<IV,ID> item)
public void removeAll()
public void addAll(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
itemsToAdd
- items to addIllegalArgumentException
- an attempt to add value that already existsSchemaException
public void addAllReplaceExisting(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
itemsToAdd
- items to addSchemaException
public <IV extends PrismValue,ID extends ItemDefinition> void replace(Item<IV,ID> oldItem, Item<IV,ID> newItem) throws SchemaException
SchemaException
public void clear()
public boolean contains(Item item)
public boolean contains(QName itemName)
public static <C extends Containerable> boolean containsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval)
public Object find(ItemPath path)
find
in interface IPrismValue
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
findPartial
in interface IPrismValue
public <X> PrismProperty<X> findProperty(QName propertyQName)
public <X> PrismProperty<X> findProperty(ItemPath propertyPath)
public <X> PrismProperty<X> findProperty(PrismPropertyDefinition<X> propertyDefinition)
Returns null if nothing is found.
propertyDefinition
- property definition to find.public <X extends Containerable> PrismContainer<X> findContainer(QName containerName)
public PrismReference findReference(QName elementName)
public PrismReference findReferenceByCompositeObjectElementName(QName elementName)
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(QName itemName, Class<I> type)
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(String itemName)
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(QName itemName)
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(ItemPath itemPath)
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(ItemDefinition itemDefinition, Class<I> type)
public boolean containsItem(ItemPath propPath, boolean acceptEmptyItem) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I createDetachedSubItem(QName name, Class<I> type, ID itemDefinition, boolean immutable) throws SchemaException
SchemaException
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(QName containerName) throws SchemaException
SchemaException
public PrismReference findOrCreateReference(QName referenceName) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findOrCreateItem(QName containerName) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(QName containerName, Class<I> type) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath path, Class<I> type, ID definition) throws SchemaException
SchemaException
public <X> PrismProperty<X> findOrCreateProperty(QName propertyQName) throws SchemaException
SchemaException
public <X> PrismProperty<X> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
SchemaException
public <X> PrismProperty<X> findOrCreateProperty(PrismPropertyDefinition propertyDef) throws SchemaException
SchemaException
public <X> PrismProperty<X> createProperty(QName propertyName) throws SchemaException
SchemaException
public <X> PrismProperty<X> createProperty(PrismPropertyDefinition propertyDefinition) throws SchemaException
SchemaException
public void removeProperty(QName propertyName)
public void removeProperty(ItemPath propertyPath)
public void removeContainer(QName containerName)
public void removeContainer(ItemPath itemPath)
public void removeReference(QName name)
public void removeReference(ItemPath path)
public <T> void setPropertyRealValue(QName propertyName, T realValue, PrismContext prismContext) throws SchemaException
SchemaException
public void recompute(PrismContext prismContext)
recompute
in interface IPrismValue
public void accept(Visitor visitor)
accept
in interface Visitable
accept
in class PrismValue
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
accept
in class PrismValue
public boolean hasCompleteDefinition()
public boolean representsSameValue(PrismValue other, boolean lax)
PrismValue
representsSameValue
in class 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.public boolean isRaw()
IPrismValue
isRaw
in interface IPrismValue
public boolean addRawElement(Object element) throws SchemaException
SchemaException
public boolean deleteRawElement(Object element) throws SchemaException
SchemaException
public boolean removeRawElement(Object element)
protected PrismContainerDefinition<C> getDefinition()
getDefinition
in class PrismValue
public void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException
applyDefinition
in interface IPrismValue
applyDefinition
in class PrismValue
SchemaException
public void applyDefinition(@NotNull PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException
SchemaException
public void revive(PrismContext prismContext) throws SchemaException
revive
in interface Revivable
revive
in class PrismValue
SchemaException
public boolean isEmpty()
isEmpty
in interface IPrismValue
public boolean isIdOnly()
public void normalize()
normalize
in interface IPrismValue
normalize
in class PrismValue
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
checkConsistenceInternal
in class PrismValue
public void assertDefinitions(String sourceDescription) throws SchemaException
SchemaException
public void assertDefinitions(boolean tolerateRaw, String sourceDescription) throws SchemaException
SchemaException
public PrismContainerValue<C> clone()
PrismValue
clone
in class PrismValue
public PrismContainerValue<C> cloneComplex(CloneStrategy strategy)
PrismValue
cloneComplex
in class PrismValue
CloneStrategy
protected void copyValues(CloneStrategy strategy, PrismContainerValue<C> clone)
protected void deepCloneDefinition(boolean ultraDeep, PrismContainerDefinition<C> clonedContainerDef, Consumer<ItemDefinition> postCloneAction)
public boolean equalsComplex(PrismValue other, boolean ignoreMetadata, boolean isLiteral)
equalsComplex
in class PrismValue
public boolean equalsComplex(PrismContainerValue<?> other, boolean ignoreMetadata, boolean isLiteral)
public boolean equivalent(PrismContainerValue<?> other)
public boolean equals(Object obj)
equals
in class PrismValue
public int hashCode()
hashCode
in class PrismValue
public String debugDump(int indent)
debugDump
in interface DebugDumpable
protected void debugDumpIdentifiers(StringBuilder sb)
protected void detailedDebugDumpStart(StringBuilder sb)
public boolean match(PrismValue otherValue)
match
in interface IPrismValue
public String toHumanReadableString()
IPrismValue
toHumanReadableString
in interface IPrismValue
@Deprecated public static void copyDefinition(Containerable aClone, Containerable original, PrismContext prismContext)
public QName getTypeName()
getTypeName
in class PrismValue
@Nullable public ComplexTypeDefinition getComplexTypeDefinition()
public static <T extends Containerable> List<PrismContainerValue<T>> toPcvList(List<T> beans)
public void setImmutable(boolean immutable)
setImmutable
in class PrismValue
public Class<?> getRealClass()
getRealClass
in class PrismValue
@Nullable public <T> T getRealValue()
getRealValue
in class PrismValue
public PrismContainer<C> asSingleValuedContainer(@NotNull QName itemName) throws SchemaException
itemName
- Item name for newly-created container.SchemaException
public void mergeContent(PrismContainerValue<?> other, List<QName> overwrite) throws SchemaException
SchemaException
public PrismContainerValue<?> getRootValue()
getRootValue
in class PrismValue
public static <C extends Containerable> List<PrismContainerValue<C>> asPrismContainerValues(List<C> containerables)
public static <C extends Containerable> List<C> asContainerables(List<PrismContainerValue<C>> pcvs)
public static <C extends Containerable> Collection<C> asContainerables(Collection<PrismContainerValue<C>> pcvs)
public void setOriginTypeRecursive(OriginType originType)
@NotNull public Collection<PrismValue> getAllValues(ItemPath path)
getAllValues
in class PrismValue
public void removeOperationalItems()
Copyright © 2019 Evolveum. All rights reserved.