Class TransformableContainerDefinition<C extends Containerable>
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.schema.transform.TransformableDefinition
-
- com.evolveum.midpoint.model.impl.schema.transform.TransformableItemDefinition<PrismContainer<C>,PrismContainerDefinition<C>>
-
- com.evolveum.midpoint.model.impl.schema.transform.TransformableContainerDefinition<C>
-
- All Implemented Interfaces:
PartiallyMutableItemDefinition<PrismContainer<C>>
,PartiallyMutableItemDefinition.Container<C>
,Definition
,ContainerDefinitionDelegator<C>
,DefinitionDelegator
,ItemDefinitionDelegator<PrismContainer<C>>
,Freezable
,ItemDefinition<PrismContainer<C>>
,LocalItemDefinitionStore
,MutableDefinition
,MutableItemDefinition<PrismContainer<C>>
,MutablePrismContainerDefinition<C>
,PrismContainerDefinition<C>
,PrismContextSensitive
,PrismItemAccessDefinition
,PrismItemAccessDefinition.Mutable
,Revivable
,SmartVisitable<Definition>
,Visitable<Definition>
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
TransformableContainerDefinition.AttributeContainer
,TransformableObjectDefinition
public class TransformableContainerDefinition<C extends Containerable> extends TransformableItemDefinition<PrismContainer<C>,PrismContainerDefinition<C>> implements ContainerDefinitionDelegator<C>, PartiallyMutableItemDefinition.Container<C>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransformableContainerDefinition.AttributeContainer
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.model.impl.schema.transform.PartiallyMutableItemDefinition
PartiallyMutableItemDefinition.Attribute<T>, PartiallyMutableItemDefinition.Container<C extends Containerable>, PartiallyMutableItemDefinition.Property<T>, PartiallyMutableItemDefinition.Reference
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismItemAccessDefinition
PrismItemAccessDefinition.Mutable
-
-
Field Summary
Fields Modifier and Type Field Description protected TransformableComplexTypeDefinition
complexTypeDefinition
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransformableContainerDefinition(PrismContainerDefinition<C> delegate)
TransformableContainerDefinition(PrismContainerDefinition<C> delegate, ComplexTypeDefinition typeDef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PrismContainerDefinition<C>
clone()
PrismContainerDefinition<C>
cloneWithReplacedDefinition(QName itemName, ItemDefinition<?> newDefinition)
TODOprotected TransformableContainerDefinition<C>
copy()
protected TransformableContainerDefinition<C>
copy(ComplexTypeDefinition def)
@NotNull ContainerDelta<C>
createEmptyDelta(ItemPath path)
Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.ItemDefinition<PrismContainer<C>>
deepClone(@NotNull DeepCloneOperation operation)
TODO documentstatic void
ensureMutableType(PrismContainerValue<?> pcv)
<C extends Containerable>
PrismContainerDefinition<C>findContainerDefinition(@NotNull ItemPath path)
ReturnsPrismContainerDefinition
corresponding to given path (rooted at this store).<T extends ItemDefinition<?>>
TfindItemDefinition(@NotNull ItemPath path, @NotNull Class<T> clazz)
Used to find a matching item definition _within_ this definition.void
freeze()
Class<C>
getCompileTimeClass()
Static (compile-time) class holding the container values.TransformableComplexTypeDefinition
getComplexTypeDefinition()
Definition of the container values.@NotNull List<? extends ItemDefinition<?>>
getDefinitions()
Returns a list of item definitions in this container.List<PrismPropertyDefinition<?>>
getPropertyDefinitions()
Returns set of property definitions.Class
getTypeClass()
Returns a compile-time class that is used to represent items.@NotNull QName
getTypeName()
Returns a name of the type for this definition.@NotNull PrismContainer<C>
instantiate()
Create an item instance.@NotNull PrismContainer<C>
instantiate(QName elementName)
Create an item instance.boolean
isEmpty()
TODOboolean
isImmutable()
static <C extends Containerable>
TransformableContainerDefinition<C>of(PrismContainerDefinition<C> originalItem)
protected PrismContainerDefinition<C>
publicView()
void
replaceDefinition(QName itemName, ItemDefinition<?> newDefinition)
TODOstatic <C extends Containerable>
TransformableContainerDefinition<C>require(PrismContainerDefinition<C> assocContainer)
MutablePrismContainerDefinition<C>
toMutable()
Returns an interface to mutate this definition.-
Methods inherited from class com.evolveum.midpoint.model.impl.schema.transform.TransformableItemDefinition
access, applyTemplate, canAdd, canModify, canRead, delegate, delegatedItem, from, getDisplayName, getDisplayOrder, getHelp, getMaxOccurs, getMinOccurs, getProcessing, getValueEnumerationRef, isDeprecated, isEmphasized, isExperimental, isMutableAccess, publicFrom, revive, setCanAdd, setCanModify, setCanRead, setDeprecated, setDisplayName, setDisplayOrder, setEmphasized, setExperimental, setHelp, setMaxOccurs, setMinOccurs, setProcessing, setValueEnumerationRef, toString
-
Methods inherited from class com.evolveum.midpoint.model.impl.schema.transform.TransformableDefinition
annotationsOverrides, getAnnotation, setAnnotation
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.prism.deleg.ContainerDefinitionDelegator
canRepresent, createValue, delegate, getItemNames, structuredType
-
Methods inherited from interface com.evolveum.midpoint.prism.deleg.DefinitionDelegator
accept, accept, debugDump, debugDump, debugDump, debugDumpLazily, debugDumpLazily, getAnnotation, getAnnotations, getDeprecatedSince, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getMutabilityFlag, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getSchemaRegistry, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAnnotation
-
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable
-
Methods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
isMandatory, isMultiValue, isOptional, isSingleValue
-
Methods inherited from interface com.evolveum.midpoint.prism.deleg.ItemDefinitionDelegator
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canBeDefinitionOf, canModify, canRead, debugDumpShortToString, getDiagrams, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isOperational, isValidFor
-
Methods inherited from interface com.evolveum.midpoint.prism.LocalItemDefinitionStore
containsItemDefinition, findItemDefinition, findLocalItemDefinition, findLocalItemDefinition, findPropertyDefinition, findReferenceDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.MutablePrismContainerDefinition
setAlwaysUseForEquals
-
Methods inherited from interface com.evolveum.midpoint.model.impl.schema.transform.PartiallyMutableItemDefinition
addDiagram, addSchemaMigration, setCanAdd, setCanModify, setCanRead, setDeprecated, setDeprecatedSince, setDisplayName, setDisplayOrder, setDocumentation, setDynamic, setElaborate, setEmphasized, setExperimental, setHelp, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setProcessing, setReadOnly, setRuntimeSchema, setSubstitutionHead, setTypeName, setValueEnumerationRef
-
Methods inherited from interface com.evolveum.midpoint.model.impl.schema.transform.PartiallyMutableItemDefinition.Container
createContainerDefinition, createContainerDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, setCompileTimeClass, setComplexTypeDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerDefinition
getAlwaysUseForEquals, isAlwaysUseForEquals, isCompletelyDefined, structuredType
-
-
-
-
Field Detail
-
complexTypeDefinition
protected final TransformableComplexTypeDefinition complexTypeDefinition
-
-
Constructor Detail
-
TransformableContainerDefinition
protected TransformableContainerDefinition(PrismContainerDefinition<C> delegate)
-
TransformableContainerDefinition
public TransformableContainerDefinition(PrismContainerDefinition<C> delegate, ComplexTypeDefinition typeDef)
-
-
Method Detail
-
of
public static <C extends Containerable> TransformableContainerDefinition<C> of(PrismContainerDefinition<C> originalItem)
-
getTypeName
@NotNull public @NotNull QName getTypeName()
Description copied from interface:Definition
Returns a name of the type for this definition. The type can be part of the compile-time schema or it can be defined at run time. Examples of the former case are types like c:UserType, xsd:string, or even flexible ones like c:ExtensionType or c:ShadowAttributesType. Examples of the latter case are types used in - custom extensions, like ext:LocationsType (where ext = e.g. http://example.com/extension), - resource schema, like ri:inetOrgPerson (ri = http://.../resource/instance-3), - connector schema, like TODO In XML representation that corresponds to the name of the XSD type. Although beware, the run-time types do not have statically defined structure. And the resource and connector-related types may even represent different kinds of objects within different contexts (e.g. two distinct resources both with ri:AccountObjectClass types). Also note that for complex type definitions, the type name serves as a unique identifier. On the other hand, for item definitions, it is just one of its attributes; primary key is item name in that case. The type name should be fully qualified. (TODO reconsider this)- Specified by:
getTypeName
in interfaceDefinition
- Specified by:
getTypeName
in interfaceDefinitionDelegator
- Returns:
- the type name
-
getTypeClass
public Class getTypeClass()
Description copied from interface:Definition
Returns a compile-time class that is used to represent items. E.g. returns String, Integer, subclasses of Objectable and Containerable and so on.- Specified by:
getTypeClass
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
getTypeClass
in interfaceDefinition
- Specified by:
getTypeClass
in interfaceDefinitionDelegator
- Specified by:
getTypeClass
in interfacePrismContainerDefinition<C extends Containerable>
-
findItemDefinition
public <T extends ItemDefinition<?>> T findItemDefinition(@NotNull @NotNull ItemPath path, @NotNull @NotNull Class<T> clazz)
Description copied from interface:ItemDefinition
Used to find a matching item definition _within_ this definition. Treats e.g. de-referencing in prism references.- Specified by:
findItemDefinition
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
findItemDefinition
in interfaceItemDefinition<C extends Containerable>
- Specified by:
findItemDefinition
in interfaceItemDefinitionDelegator<C extends Containerable>
- Specified by:
findItemDefinition
in interfaceLocalItemDefinitionStore
-
findContainerDefinition
public <C extends Containerable> PrismContainerDefinition<C> findContainerDefinition(@NotNull @NotNull ItemPath path)
Description copied from interface:LocalItemDefinitionStore
ReturnsPrismContainerDefinition
corresponding to given path (rooted at this store). Tries the global resolution in the case of "any" content.- Specified by:
findContainerDefinition
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
findContainerDefinition
in interfaceLocalItemDefinitionStore
-
getCompileTimeClass
public Class<C> getCompileTimeClass()
Description copied from interface:PrismContainerDefinition
Static (compile-time) class holding the container values. May be null. (Let's not mark it as @Nullable to avoid lots of warnings.)- Specified by:
getCompileTimeClass
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
getCompileTimeClass
in interfacePrismContainerDefinition<C extends Containerable>
-
getComplexTypeDefinition
public TransformableComplexTypeDefinition getComplexTypeDefinition()
Description copied from interface:PrismContainerDefinition
Definition of the container values. May be null. (Let's not mark it as @Nullable to avoid lots of warnings.) Note that individual values can hold their own (more specific) complex type definitions.- Specified by:
getComplexTypeDefinition
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
getComplexTypeDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrismContainerDefinition
TODO- Specified by:
isEmpty
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
isEmpty
in interfacePrismContainerDefinition<C extends Containerable>
-
getDefinitions
@NotNull public @NotNull List<? extends ItemDefinition<?>> getDefinitions()
Description copied from interface:PrismContainerDefinition
Returns a list of item definitions in this container. It is intentionally aList
because it is ordered. (To provide standard format for serialization.) Usually obtained fromComplexTypeDefinition
. So please do not modify the content of the list!- Specified by:
getDefinitions
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
getDefinitions
in interfaceLocalItemDefinitionStore
- Specified by:
getDefinitions
in interfacePrismContainerDefinition<C extends Containerable>
-
getPropertyDefinitions
public List<PrismPropertyDefinition<?>> getPropertyDefinitions()
Description copied from interface:PrismContainerDefinition
Returns set of property definitions. The set contains all property definitions of all types that were parsed. Order of definitions is insignificant. The returned set is immutable! All changes may be lost.- Specified by:
getPropertyDefinitions
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
getPropertyDefinitions
in interfacePrismContainerDefinition<C extends Containerable>
- Returns:
- set of definitions
-
createEmptyDelta
@NotNull public @NotNull ContainerDelta<C> createEmptyDelta(ItemPath path)
Description copied from interface:ItemDefinition
Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.- Specified by:
createEmptyDelta
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
createEmptyDelta
in interfaceItemDefinition<C extends Containerable>
- Specified by:
createEmptyDelta
in interfaceItemDefinitionDelegator<C extends Containerable>
- Specified by:
createEmptyDelta
in interfacePrismContainerDefinition<C extends Containerable>
-
clone
@NotNull public @NotNull PrismContainerDefinition<C> clone()
- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<C extends Containerable>
- Specified by:
clone
in interfacePrismContainerDefinition<C extends Containerable>
- Overrides:
clone
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
deepClone
public ItemDefinition<PrismContainer<C>> deepClone(@NotNull @NotNull DeepCloneOperation operation)
Description copied from interface:ItemDefinition
TODO document- Specified by:
deepClone
in interfaceItemDefinition<C extends Containerable>
- Specified by:
deepClone
in interfaceItemDefinitionDelegator<C extends Containerable>
- Overrides:
deepClone
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
copy
protected TransformableContainerDefinition<C> copy(ComplexTypeDefinition def)
-
cloneWithReplacedDefinition
public PrismContainerDefinition<C> cloneWithReplacedDefinition(QName itemName, ItemDefinition<?> newDefinition)
Description copied from interface:PrismContainerDefinition
TODO- Specified by:
cloneWithReplacedDefinition
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
cloneWithReplacedDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
replaceDefinition
public void replaceDefinition(QName itemName, ItemDefinition<?> newDefinition)
Description copied from interface:PrismContainerDefinition
TODO- Specified by:
replaceDefinition
in interfaceContainerDefinitionDelegator<C extends Containerable>
- Specified by:
replaceDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
toMutable
public MutablePrismContainerDefinition<C> toMutable()
Description copied from interface:Definition
Returns an interface to mutate this definition.- Specified by:
toMutable
in interfaceDefinition
- Specified by:
toMutable
in interfaceItemDefinition<C extends Containerable>
- Specified by:
toMutable
in interfacePrismContainerDefinition<C extends Containerable>
- Overrides:
toMutable
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
isImmutable
public boolean isImmutable()
- Specified by:
isImmutable
in interfaceFreezable
- Overrides:
isImmutable
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
freeze
public void freeze()
- Specified by:
freeze
in interfaceFreezable
- Overrides:
freeze
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
instantiate
@NotNull public @NotNull PrismContainer<C> instantiate() throws SchemaException
Description copied from interface:ItemDefinition
Create an item instance. Definition name or default name will be used as an element name for the instance. The instance will otherwise be empty.- Specified by:
instantiate
in interfaceItemDefinition<C extends Containerable>
- Specified by:
instantiate
in interfaceItemDefinitionDelegator<C extends Containerable>
- Throws:
SchemaException
-
instantiate
@NotNull public @NotNull PrismContainer<C> instantiate(QName elementName) throws SchemaException
Description copied from interface:ItemDefinition
Create an item instance. Definition name will use provided name. for the instance. The instance will otherwise be empty.- Specified by:
instantiate
in interfaceItemDefinition<C extends Containerable>
- Specified by:
instantiate
in interfaceItemDefinitionDelegator<C extends Containerable>
- Overrides:
instantiate
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
- Throws:
SchemaException
-
publicView
protected PrismContainerDefinition<C> publicView()
- Specified by:
publicView
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
ensureMutableType
public static void ensureMutableType(PrismContainerValue<?> pcv)
-
require
public static <C extends Containerable> TransformableContainerDefinition<C> require(PrismContainerDefinition<C> assocContainer)
-
copy
protected TransformableContainerDefinition<C> copy()
- Specified by:
copy
in classTransformableItemDefinition<PrismContainer<C extends Containerable>,PrismContainerDefinition<C extends Containerable>>
-
-