public class PrismContainer<V extends Containerable> extends Item<PrismContainerValue<V>> implements PrismContainerable<V>
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<V> |
compileTimeClass |
definition, name, parent, prismContext
INDENT_STRING
Modifier | Constructor and Description |
---|---|
|
PrismContainer(QName name) |
|
PrismContainer(QName name,
Class<V> compileTimeClass) |
protected |
PrismContainer(QName name,
PrismContainerDefinition<V> definition,
PrismContext prismContext) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor,
ItemPath path,
boolean recursive) |
void |
add(Item<?> item)
Convenience method.
|
protected String |
additionalDumpDescription() |
void |
applyDefinition(ItemDefinition definition) |
void |
assertDefinitions(boolean tolarateRaw,
String sourceDescription) |
boolean |
canRepresent(Class<?> compileTimeClass)
Returns true if this object can represent specified compile-time class.
|
void |
checkConsistenceInternal(Itemable rootItem,
boolean requireDefinitions,
boolean prohibitRaw) |
protected void |
checkDefinition(ItemDefinition def) |
PrismContainer<V> |
clone() |
boolean |
containsEquivalentValue(PrismContainerValue<V> value) |
protected void |
copyValues(PrismContainer<V> clone) |
ContainerDelta<V> |
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition
represents (e.g.
|
ContainerDelta<V> |
createDelta(ItemPath path) |
PrismContainerValue<V> |
createNewValue() |
String |
debugDump(int indent) |
String |
dump()
Show the content of the object intended for diagnostics by developer.
|
boolean |
equals(Object obj) |
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) |
<X extends PrismValue> |
findItem(ItemPath propPath) |
<I extends Item<?>> |
findItem(ItemPath propPath,
Class<I> type) |
Item<?> |
findItem(QName itemQName) |
<I extends Item<?>> |
findItem(QName itemQName,
Class<I> type) |
<T extends Containerable> |
findOrCreateContainer(ItemPath containerPath) |
<T extends Containerable> |
findOrCreateContainer(QName containerName) |
<T extends Item<?>> |
findOrCreateItem(ItemPath containerPath,
Class<T> type) |
<T extends Item<?>> |
findOrCreateItem(ItemPath containerPath,
Class<T> type,
ItemDefinition definition) |
<T> PrismProperty<T> |
findOrCreateProperty(ItemPath propertyPath) |
<T> PrismProperty<T> |
findOrCreateProperty(QName propertyName) |
PrismReference |
findOrCreateReference(ItemPath propertyPath) |
PrismReference |
findOrCreateReference(QName propertyName) |
<X extends PrismValue> |
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) |
Class<V> |
getCompileTimeClass() |
protected String |
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.
|
PrismContainerDefinition<V> |
getDefinition()
Returns applicable property container definition.
|
PrismContainerValue<V> |
getNextValue(PrismValue value)
Returns values that is following the specified value.
|
PrismContainerValue<V> |
getPreviousValue(PrismValue value)
Returns value that is previous to the specified value.
|
<T> T |
getPropertyRealValue(QName propertyName,
Class<T> type) |
PrismContainerValue<V> |
getValue() |
PrismContainerValue<V> |
getValue(Long id) |
List<PrismContainerValue<V>> |
getValues() |
boolean |
hasCompleteDefinition()
Returns true if the object and all contained prisms have proper definition.
|
int |
hashCode() |
boolean |
isEmpty() |
void |
mergeValue(PrismContainerValue<V> otherValue) |
void |
mergeValues(Collection<PrismContainerValue<V>> otherValues) |
void |
mergeValues(PrismContainer<V> other) |
static <V extends Containerable> |
newInstance(PrismContext prismContext,
QName type) |
void |
remove(Item<?> item)
Convenience method.
|
void |
removeContainer(ItemPath path) |
void |
removeContainer(QName containerQName) |
<I extends Item<?>> |
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<V> definition)
Sets applicable property container definition.
|
void |
setPropertyRealValue(QName propertyName,
Object realValue) |
void |
setValue(PrismContainerValue<V> value) |
String |
toString() |
void |
trim()
Remove all empty values
|
accept, add, addAll, applyDefinition, asDomElements, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, clear, cloneCollection, contains, contains, containsRealValue, copyValues, createNewDefinitionlessItem, debugDump, diff, diff, diffInternal, equalsRealValue, findValue, fixupDelta, getClonedValues, getDisplayName, getHelp, getName, getParent, getPath, getPrismContext, getUserData, getUserData, getValue, hasRaw, hasRealValue, hasValue, hasValue, isRaw, isSingleValue, match, normalize, remove, remove, removeAll, replace, replaceAll, resetParentCollection, revive, setDefinition, setName, setParent, setPrismContext, setUserData, size
finalize, getClass, notify, notifyAll, wait, wait, wait
getName, getPath, getPrismContext
protected Class<V extends Containerable> compileTimeClass
public PrismContainer(QName name)
protected PrismContainer(QName name, PrismContainerDefinition<V> definition, PrismContext prismContext)
public Class<V> getCompileTimeClass()
getCompileTimeClass
in interface PrismContainerable<V extends Containerable>
public boolean canRepresent(Class<?> compileTimeClass)
public List<PrismContainerValue<V>> getValues()
getValues
in class Item<PrismContainerValue<V extends Containerable>>
public PrismContainerValue<V> getValue()
public void setValue(PrismContainerValue<V> value) throws SchemaException
SchemaException
public PrismContainerValue<V> getPreviousValue(PrismValue value)
Item
getPreviousValue
in class Item<PrismContainerValue<V extends Containerable>>
public PrismContainerValue<V> getNextValue(PrismValue value)
Item
getNextValue
in class Item<PrismContainerValue<V extends Containerable>>
public PrismContainerValue<V> getValue(Long id)
public void setPropertyRealValue(QName propertyName, Object realValue) throws SchemaException
SchemaException
public void add(Item<?> item) throws SchemaException
SchemaException
public PrismContainerValue<V> createNewValue()
public void mergeValues(PrismContainer<V> other) throws SchemaException
SchemaException
public void mergeValues(Collection<PrismContainerValue<V>> otherValues) throws SchemaException
SchemaException
public void mergeValue(PrismContainerValue<V> otherValue) throws SchemaException
SchemaException
public void trim()
public PrismContainerDefinition<V> getDefinition()
getDefinition
in interface Itemable
getDefinition
in interface PrismContainerable<V extends Containerable>
getDefinition
in class Item<PrismContainerValue<V extends Containerable>>
public void setDefinition(PrismContainerDefinition<V> definition)
definition
- the definition to setpublic void applyDefinition(ItemDefinition definition) throws SchemaException
applyDefinition
in class Item<PrismContainerValue<V extends Containerable>>
SchemaException
public boolean hasCompleteDefinition()
hasCompleteDefinition
in class Item<PrismContainerValue<V extends Containerable>>
public Object find(ItemPath path)
find
in class Item<PrismContainerValue<V extends Containerable>>
public <X extends PrismValue> PartiallyResolvedValue<X> findPartial(ItemPath path)
findPartial
in class Item<PrismContainerValue<V extends Containerable>>
public <X extends PrismValue> Item<X> findItem(ItemPath propPath)
public <T extends Containerable> PrismContainer<T> findContainer(ItemPath path)
public <T extends Containerable> PrismContainer<T> findContainer(QName containerName)
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 <T extends Item<?>> T findOrCreateItem(ItemPath containerPath, Class<T> type) throws SchemaException
SchemaException
public <T extends Item<?>> T findOrCreateItem(ItemPath containerPath, Class<T> type, ItemDefinition 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 ContainerDelta<V> createDelta()
Item
createDelta
in class Item<PrismContainerValue<V extends Containerable>>
public ContainerDelta<V> createDelta(ItemPath path)
createDelta
in class Item<PrismContainerValue<V extends Containerable>>
public boolean isEmpty()
isEmpty
in class Item<PrismContainerValue<V extends Containerable>>
protected void checkDefinition(ItemDefinition def)
checkDefinition
in class Item<PrismContainerValue<V extends Containerable>>
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw)
checkConsistenceInternal
in class Item<PrismContainerValue<V extends Containerable>>
public void assertDefinitions(boolean tolarateRaw, String sourceDescription) throws SchemaException
assertDefinitions
in class Item<PrismContainerValue<V extends Containerable>>
SchemaException
public PrismContainer<V> clone()
clone
in class Item<PrismContainerValue<V extends Containerable>>
protected void copyValues(PrismContainer<V> clone)
public boolean containsEquivalentValue(PrismContainerValue<V> value)
containsEquivalentValue
in class Item<PrismContainerValue<V extends Containerable>>
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
accept
in class Item<PrismContainerValue<V extends Containerable>>
public int hashCode()
hashCode
in class Item<PrismContainerValue<V extends Containerable>>
public boolean equals(Object obj)
equals
in class Item<PrismContainerValue<V extends Containerable>>
public boolean equivalent(Object obj)
public String toString()
toString
in class Item<PrismContainerValue<V extends Containerable>>
public String dump()
Dumpable
dump
in interface Dumpable
dump
in class Item<PrismContainerValue<V extends Containerable>>
public String debugDump(int indent)
debugDump
in interface DebugDumpable
debugDump
in class Item<PrismContainerValue<V extends Containerable>>
protected String additionalDumpDescription()
public static <V extends Containerable> PrismContainer<V> newInstance(PrismContext prismContext, QName type) throws SchemaException
SchemaException
protected String getDebugDumpClassName()
getDebugDumpClassName
in class Item<PrismContainerValue<V extends Containerable>>
Copyright © 2013 evolveum. All rights reserved.