public class PrismContainer<C extends Containerable> extends Item<PrismContainerValue<C>,PrismContainerDefinition<C>> implements PrismContainerable<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.
Modifier and Type | Field and Description |
---|---|
protected Class<C> |
compileTimeClass |
definition, elementName, immutable, incomplete, parent, prismContext, values
INDENT_STRING
Constructor and Description |
---|
PrismContainer(QName name) |
PrismContainer(QName name,
Class<C> compileTimeClass) |
PrismContainer(QName name,
Class<C> compileTimeClass,
PrismContext prismContext) |
PrismContainer(QName name,
PrismContainerDefinition<C> definition,
PrismContext prismContext) |
PrismContainer(QName name,
PrismContext prismContext) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor,
ItemPath path,
boolean recursive) |
void |
add(Item<?,?> item)
Convenience method.
|
boolean |
add(PrismContainerValue newValue,
boolean checkUniqueness) |
void |
applyDefinition(PrismContainerDefinition<C> definition) |
void |
assertDefinitions(boolean tolarateRaw,
String sourceDescription) |
boolean |
canRepresent(Class<?> compileTimeClass)
Returns true if this object can represent specified compile-time class.
|
boolean |
canRepresent(QName type) |
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 |
containsEquivalentValue(PrismContainerValue<C> value) |
boolean |
containsEquivalentValue(PrismContainerValue<C> value,
Comparator<PrismContainerValue<C>> comparator) |
boolean |
containsItem(ItemPath itemPath,
boolean acceptEmptyItem) |
protected void |
copyValues(CloneStrategy strategy,
PrismContainer<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) |
PrismContainerValue<C> |
createNewValue() |
static <V extends PrismContainerValue> |
createParentIfNeeded(V value,
ItemDefinition definition) |
String |
debugDump(int indent) |
PrismContainerDefinition<C> |
deepCloneDefinition(boolean ultraDeep,
Consumer<ItemDefinition> postCloneAction) |
ContainerDelta<C> |
diff(PrismContainer<C> other) |
ContainerDelta<C> |
diff(PrismContainer<C> other,
boolean ignoreMetadata,
boolean isLiteral) |
List<? extends ItemDelta> |
diffModifications(PrismContainer<C> other) |
List<? extends ItemDelta> |
diffModifications(PrismContainer<C> other,
boolean ignoreMetadata,
boolean isLiteral) |
boolean |
equals(Object obj)
Note: hashcode and equals compare the objects in the "java way".
|
boolean |
equivalent(Object obj)
This method ignores some part of the object during comparison (e.g.
|
Object |
find(ItemPath path) |
<T extends Containerable> |
findContainer(ItemPath path) |
<T extends Containerable> |
findContainer(QName containerName) |
<IV extends PrismValue,ID extends ItemDefinition> |
findItem(ItemPath path) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findItem(ItemPath path,
Class<I> type) |
<IV extends PrismValue,ID extends ItemDefinition> |
findItem(QName itemQName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findItem(QName itemQName,
Class<I> type) |
<T extends Containerable> |
findOrCreateContainer(ItemPath containerPath) |
<T extends Containerable> |
findOrCreateContainer(QName containerName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findOrCreateItem(ItemPath containerPath,
Class<I> type) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
findOrCreateItem(ItemPath containerPath,
Class<I> type,
ID definition) |
<T> PrismProperty<T> |
findOrCreateProperty(ItemPath propertyPath) |
<T> PrismProperty<T> |
findOrCreateProperty(QName propertyName) |
PrismReference |
findOrCreateReference(ItemPath propertyPath) |
PrismReference |
findOrCreateReference(QName propertyName) |
<IV extends PrismValue,ID extends ItemDefinition> |
findPartial(ItemPath path) |
<T> PrismProperty<T> |
findProperty(ItemPath path) |
<T> PrismProperty<T> |
findProperty(QName propertyQName) |
PrismReference |
findReference(ItemPath path) |
PrismReference |
findReference(QName referenceQName) |
PrismReference |
findReferenceByCompositeObjectElementName(QName elementName) |
PrismContainerValue<C> |
findValue(long id) |
Class<C> |
getCompileTimeClass() |
List<PrismContainer<?>> |
getContainers() |
protected String |
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.
|
PrismContainerDefinition<C> |
getDefinition()
Returns applicable property container definition.
|
<I extends Item<?,?>> |
getItems(Class<I> type) |
PrismContainerValue<C> |
getNextValue(PrismValue value)
Returns values that is following the specified value.
|
PrismContainerValue<C> |
getOrCreateValue() |
PrismContainerValue<C> |
getPreviousValue(PrismValue value)
Returns value that is previous to the specified value.
|
<T> T |
getPropertyRealValue(ItemPath propertyPath,
Class<T> type) |
<T> T |
getPropertyRealValue(QName propertyName,
Class<T> type) |
C |
getRealValue() |
Collection<C> |
getRealValues() |
PrismContainerValue<C> |
getValue() |
PrismContainerValue<C> |
getValue(Long id) |
boolean |
hasCompleteDefinition()
Returns true if the object and all contained prisms have proper definition.
|
int |
hashCode()
Note: hashcode and equals compare the objects in the "java way".
|
boolean |
isEmpty() |
void |
mergeValue(PrismContainerValue<C> otherValue) |
void |
mergeValues(Collection<PrismContainerValue<C>> otherValues) |
void |
mergeValues(PrismContainer<C> other) |
static <V extends Containerable> |
newInstance(PrismContext prismContext,
QName type) |
protected void |
propagateDeepCloneDefinition(boolean ultraDeep,
PrismContainerDefinition<C> clonedDef,
Consumer<ItemDefinition> postCloneAction) |
void |
remove(Item<?,?> item)
Convenience method.
|
void |
removeContainer(ItemPath path) |
void |
removeContainer(QName containerQName) |
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> |
removeItem(ItemPath path,
Class<I> itemType) |
void |
removeProperty(ItemPath path) |
void |
removeProperty(QName propertyQName) |
void |
removeReference(ItemPath path) |
void |
removeReference(QName referenceQName) |
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 |
setValue(PrismContainerValue<C> value) |
String |
toString() |
void |
trim()
Remove all empty values
|
void |
trimDefinitionTree(Collection<ItemPath> alwaysKeep)
Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container.
|
accept, add, addAll, appendDebugDumpSuffix, applyDefinition, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkImmutability, checkMutability, clear, cloneCollection, contains, contains, contains, containsRealValue, copyValues, createNewDefinitionlessItem, diff, diff, diffInternal, equalsRealValue, filterValues, findValue, findValuesIgnoreMetadata, fixupDelta, getAllValues, getAllValues, getClonedValues, getDisplayName, getElementName, getHelp, getParent, getPath, getPrismContext, getPrismContextLocal, getUserData, getUserData, getValue, getValues, getValues, hasNoValues, hasNoValues, hasRaw, hasRealValue, hasValue, hasValue, isImmutable, isIncomplete, isMetadata, isRaw, isSingleValue, match, merge, modifyUnfrozen, normalize, recomputeAllValues, remove, remove, removeAll, replace, replaceAll, resetParentCollection, revive, setElementName, setImmutable, setIncomplete, setParent, setPrismContext, setUserData, size, valuesExactMatch
finalize, getClass, notify, notifyAll, wait, wait, wait
getComplexTypeDefinition
getElementName, getPath, getPrismContext
debugDump, debugDumpLazily, debugDumpLazily
protected Class<C extends Containerable> compileTimeClass
public PrismContainer(QName name)
public PrismContainer(QName name, PrismContext prismContext)
public PrismContainer(QName name, Class<C> compileTimeClass, PrismContext prismContext)
public PrismContainer(QName name, PrismContainerDefinition<C> definition, PrismContext prismContext)
public Class<C> getCompileTimeClass()
getCompileTimeClass
in interface PrismContainerable<C extends Containerable>
public boolean canRepresent(Class<?> compileTimeClass)
public boolean canRepresent(QName type)
@NotNull public Collection<C> getRealValues()
getRealValues
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public C getRealValue()
getRealValue
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public PrismContainerValue<C> getOrCreateValue()
public PrismContainerValue<C> getValue()
public void setValue(@NotNull PrismContainerValue<C> value) throws SchemaException
SchemaException
public boolean add(@NotNull PrismContainerValue newValue, boolean checkUniqueness) throws SchemaException
add
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
SchemaException
public PrismContainerValue<C> getPreviousValue(PrismValue value)
Item
getPreviousValue
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public PrismContainerValue<C> getNextValue(PrismValue value)
Item
getNextValue
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public PrismContainerValue<C> getValue(Long id)
public <T> void setPropertyRealValue(QName propertyName, T realValue) throws SchemaException
SchemaException
public <T> void setPropertyRealValues(QName propertyName, T... realValues) throws SchemaException
SchemaException
public void add(Item<?,?> item) throws SchemaException
SchemaException
public PrismContainerValue<C> createNewValue()
public void mergeValues(PrismContainer<C> other) throws SchemaException
SchemaException
public void mergeValues(Collection<PrismContainerValue<C>> otherValues) throws SchemaException
SchemaException
public void mergeValue(PrismContainerValue<C> otherValue) throws SchemaException
SchemaException
public void trim()
public PrismContainerDefinition<C> getDefinition()
May return null if no definition is applicable or the definition is not know.
getDefinition
in interface Itemable
getDefinition
in interface PrismContainerable<C extends Containerable>
getDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public void setDefinition(PrismContainerDefinition<C> definition)
setDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
definition
- the definition to setpublic void applyDefinition(PrismContainerDefinition<C> definition) throws SchemaException
applyDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(QName itemQName, Class<I> type)
public boolean hasCompleteDefinition()
hasCompleteDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public Object find(ItemPath path)
find
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
findPartial
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(QName itemQName)
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(ItemPath path, Class<I> type)
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(ItemPath path)
public boolean containsItem(ItemPath itemPath, boolean acceptEmptyItem) throws SchemaException
SchemaException
public PrismContainerValue<C> findValue(long id)
public <T extends Containerable> PrismContainer<T> findContainer(ItemPath path)
public <T extends Containerable> PrismContainer<T> findContainer(QName containerName)
public List<PrismContainer<?>> getContainers()
public <T> PrismProperty<T> findProperty(ItemPath path)
public <T> PrismProperty<T> findProperty(QName propertyQName)
public PrismReference findReference(ItemPath path)
public PrismReference findReference(QName referenceQName)
public PrismReference findReferenceByCompositeObjectElementName(QName elementName)
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type) throws SchemaException
SchemaException
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type, ID definition) throws SchemaException
SchemaException
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath) throws SchemaException
SchemaException
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(QName containerName) throws SchemaException
SchemaException
public <T> PrismProperty<T> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
SchemaException
public <T> PrismProperty<T> findOrCreateProperty(QName propertyName) throws SchemaException
SchemaException
public PrismReference findOrCreateReference(ItemPath propertyPath) throws SchemaException
SchemaException
public PrismReference findOrCreateReference(QName propertyName) throws SchemaException
SchemaException
public void remove(Item<?,?> item)
public void removeProperty(QName propertyQName)
public void removeProperty(ItemPath path)
public void removeContainer(QName containerQName)
public void removeContainer(ItemPath path)
public void removeReference(QName referenceQName)
public void removeReference(ItemPath path)
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> void removeItem(ItemPath path, Class<I> itemType)
public ContainerDelta<C> createDelta()
Item
createDelta
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public ContainerDelta<C> createDelta(ItemPath path)
createDelta
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public boolean isEmpty()
isEmpty
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
protected void checkDefinition(PrismContainerDefinition<C> def)
checkDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
checkConsistenceInternal
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public void assertDefinitions(boolean tolarateRaw, String sourceDescription) throws SchemaException
assertDefinitions
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
SchemaException
public ContainerDelta<C> diff(PrismContainer<C> other)
public ContainerDelta<C> diff(PrismContainer<C> other, boolean ignoreMetadata, boolean isLiteral)
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other)
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other, boolean ignoreMetadata, boolean isLiteral)
public PrismContainer<C> clone()
Item
clone
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public PrismContainer<C> cloneComplex(CloneStrategy strategy)
Item
cloneComplex
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
CloneStrategy
protected void copyValues(CloneStrategy strategy, PrismContainer<C> clone)
public PrismContainerDefinition<C> deepCloneDefinition(boolean ultraDeep, Consumer<ItemDefinition> postCloneAction)
protected void propagateDeepCloneDefinition(boolean ultraDeep, PrismContainerDefinition<C> clonedDef, Consumer<ItemDefinition> postCloneAction)
propagateDeepCloneDefinition
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public boolean containsEquivalentValue(PrismContainerValue<C> value)
containsEquivalentValue
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public boolean containsEquivalentValue(PrismContainerValue<C> value, Comparator<PrismContainerValue<C>> comparator)
containsEquivalentValue
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
accept
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public int hashCode()
hashCode
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public boolean equals(Object obj)
equals
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public boolean equivalent(Object obj)
public String toString()
toString
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public String debugDump(int indent)
debugDump
in interface DebugDumpable
debugDump
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public static <V extends Containerable> PrismContainer<V> newInstance(PrismContext prismContext, QName type) throws SchemaException
SchemaException
protected String getDebugDumpClassName()
getDebugDumpClassName
in class Item<PrismContainerValue<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
public static <V extends PrismContainerValue> void createParentIfNeeded(V value, ItemDefinition definition) throws SchemaException
SchemaException
public void trimDefinitionTree(Collection<ItemPath> alwaysKeep)
Copyright © 2019 Evolveum. All rights reserved.