Class PrismContainerDefinitionImpl<C extends Containerable>
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.DefinitionImpl
-
- com.evolveum.midpoint.prism.impl.ItemDefinitionImpl<PrismContainer<C>>
-
- com.evolveum.midpoint.prism.impl.PrismContainerDefinitionImpl<C>
-
- All Implemented Interfaces:
Definition
,ItemDefinition<PrismContainer<C>>
,LocalDefinitionStore
,MutableDefinition
,MutableItemDefinition<PrismContainer<C>>
,MutablePrismContainerDefinition<C>
,PrismContainerDefinition<C>
,Revivable
,Visitable
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
PrismObjectDefinitionImpl
,ResourceAttributeContainerDefinitionImpl
public class PrismContainerDefinitionImpl<C extends Containerable> extends ItemDefinitionImpl<PrismContainer<C>> implements MutablePrismContainerDefinition<C>
Definition of a property container.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. 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.
This class represents schema definition for property container. See
Definition
for more details.- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<C>
compileTimeClass
protected ComplexTypeDefinition
complexTypeDefinition
-
Fields inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
heterogeneousListItem, itemName, substitutionHead
-
Fields inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
deprecated, deprecatedSince, displayName, displayOrder, documentation, elaborate, emphasized, experimental, help, isAbstract, isRuntimeSchema, plannedRemoval, prismContext, processing, typeName
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismContainerDefinitionImpl(QName name, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
The constructors should be used only occasionally (if used at all).PrismContainerDefinitionImpl(QName name, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext, Class<C> compileTimeClass)
-
Method Summary
-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, copyDefinitionData, debugDumpShortToString, debugFlags, debugMultiplicity, deepClone, equals, extendToString, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, hashCode, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor, setCanAdd, setCanModify, setCanRead, setDynamic, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setReadOnly, setSubstitutionHead, setValueEnumerationRef, toString
-
Methods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
addSchemaMigration, copyDefinitionData, extendDumpHeader, getAnnotation, getDeprecatedSince, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getTypeClassIfKnown, getTypeName, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAbstract, setAnnotation, setDeprecated, setDeprecatedSince, setDisplayName, setDisplayOrder, setDocumentation, setElaborate, setEmphasized, setExperimental, setHelp, setPlannedRemoval, setProcessing, setRuntimeSchema, setTypeName
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Definition
getAnnotation, getDeprecatedSince, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getSchemaRegistry, getTypeClassIfKnown, getTypeName, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAnnotation
-
Methods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, debugDumpShortToString, deepClone, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor
-
Methods inherited from interface com.evolveum.midpoint.prism.LocalDefinitionStore
findContainerDefinition, findContainerDefinition, findItemDefinition, findLocalItemDefinition, findPropertyDefinition, findReferenceDefinition, findReferenceDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableDefinition
addSchemaMigration, setDeprecated, setDisplayName, setDisplayOrder, setDocumentation, setEmphasized, setExperimental, setHelp, setProcessing, setRuntimeSchema, setTypeName
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableItemDefinition
setCanAdd, setCanModify, setCanRead, setDeprecatedSince, setDynamic, setElaborate, setHeterogeneousListItem, setIndexOnly, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setReadOnly, setSubstitutionHead, setValueEnumerationRef
-
Methods inherited from interface com.evolveum.midpoint.prism.MutablePrismContainerDefinition
setInherited
-
-
-
-
Field Detail
-
complexTypeDefinition
protected ComplexTypeDefinition complexTypeDefinition
-
compileTimeClass
protected Class<C extends Containerable> compileTimeClass
-
-
Constructor Detail
-
PrismContainerDefinitionImpl
public PrismContainerDefinitionImpl(@NotNull QName name, ComplexTypeDefinition complexTypeDefinition, @NotNull PrismContext prismContext)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.
-
PrismContainerDefinitionImpl
public PrismContainerDefinitionImpl(@NotNull QName name, ComplexTypeDefinition complexTypeDefinition, @NotNull PrismContext prismContext, Class<C> compileTimeClass)
-
-
Method Detail
-
getCompileTimeClass
public Class<C> getCompileTimeClass()
- Specified by:
getCompileTimeClass
in interfacePrismContainerDefinition<C extends Containerable>
-
setCompileTimeClass
public void setCompileTimeClass(Class<C> compileTimeClass)
- Specified by:
setCompileTimeClass
in interfaceMutablePrismContainerDefinition<C extends Containerable>
-
getTypeClass
public Class<C> getTypeClass()
Description copied from interface:Definition
Returns a compile-time class that is used to represent items. E.g. returns String, Integer, sublcasses of Objectable and Containerable and so on.- Specified by:
getTypeClass
in interfaceDefinition
- Specified by:
getTypeClass
in interfacePrismContainerDefinition<C extends Containerable>
- Overrides:
getTypeClass
in classDefinitionImpl
-
getSchemaNamespace
protected String getSchemaNamespace()
-
getComplexTypeDefinition
public ComplexTypeDefinition getComplexTypeDefinition()
- Specified by:
getComplexTypeDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
setComplexTypeDefinition
public void setComplexTypeDefinition(ComplexTypeDefinition complexTypeDefinition)
- Specified by:
setComplexTypeDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceDefinition
- Overrides:
isAbstract
in classDefinitionImpl
-
revive
public void revive(PrismContext prismContext)
- Specified by:
revive
in interfaceItemDefinition<C extends Containerable>
- Specified by:
revive
in interfacePrismContainerDefinition<C extends Containerable>
- Specified by:
revive
in interfaceRevivable
- Overrides:
revive
in classItemDefinitionImpl<PrismContainer<C extends Containerable>>
-
findLocalItemDefinition
public <D extends ItemDefinition> D findLocalItemDefinition(@NotNull QName name, @NotNull Class<D> clazz, boolean caseInsensitive)
- Specified by:
findLocalItemDefinition
in interfaceLocalDefinitionStore
-
getDefaultNamespace
public String getDefaultNamespace()
- Specified by:
getDefaultNamespace
in interfacePrismContainerDefinition<C extends Containerable>
-
getIgnoredNamespaces
public List<String> getIgnoredNamespaces()
- Specified by:
getIgnoredNamespaces
in interfacePrismContainerDefinition<C extends Containerable>
-
findItemDefinition
public <ID extends ItemDefinition> ID findItemDefinition(@NotNull ItemPath path, @NotNull Class<ID> clazz)
- Specified by:
findItemDefinition
in interfaceItemDefinition<C extends Containerable>
- Specified by:
findItemDefinition
in interfaceLocalDefinitionStore
- Overrides:
findItemDefinition
in classItemDefinitionImpl<PrismContainer<C extends Containerable>>
-
findNamedItemDefinition
public <ID extends ItemDefinition> ID findNamedItemDefinition(@NotNull QName firstName, @NotNull ItemPath rest, @NotNull Class<ID> clazz)
- Specified by:
findNamedItemDefinition
in interfaceLocalDefinitionStore
-
getDefinitions
public List<? extends ItemDefinition> getDefinitions()
Returns set of property definitions.WARNING: This may return definitions from the associated complex type. Therefore changing the returned set may influence also the complex type definition.
The set contains all property definitions of all types that were parsed. Order of definitions is insignificant.
- Specified by:
getDefinitions
in interfacePrismContainerDefinition<C extends Containerable>
- Returns:
- set of definitions
-
getPropertyDefinitions
public List<PrismPropertyDefinition> getPropertyDefinitions()
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 interfacePrismContainerDefinition<C extends Containerable>
- Returns:
- set of definitions
-
instantiate
@NotNull public PrismContainer<C> instantiate() throws SchemaException
Description copied from interface:ItemDefinition
Create an item instance. Definition name or default name will used as an element name for the instance. The instance will otherwise be empty.- Specified by:
instantiate
in interfaceItemDefinition<C extends Containerable>
- Returns:
- created item instance
- Throws:
SchemaException
-
instantiate
@NotNull public 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>
- Returns:
- created item instance
- Throws:
SchemaException
-
createEmptyDelta
public ContainerDelta<C> createEmptyDelta(ItemPath path)
- Specified by:
createEmptyDelta
in interfaceItemDefinition<C extends Containerable>
- Specified by:
createEmptyDelta
in interfacePrismContainerDefinition<C extends Containerable>
-
accept
public void accept(Visitor visitor)
- Specified by:
accept
in interfaceVisitable<C extends Containerable>
- Overrides:
accept
in classItemDefinitionImpl<PrismContainer<C extends Containerable>>
-
clone
@NotNull public PrismContainerDefinitionImpl<C> clone()
Shallow clone- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<C extends Containerable>
- Specified by:
clone
in interfacePrismContainerDefinition<C extends Containerable>
- Specified by:
clone
in classItemDefinitionImpl<PrismContainer<C extends Containerable>>
-
copyDefinitionData
protected void copyDefinitionData(PrismContainerDefinitionImpl<C> clone)
-
deepClone
public ItemDefinition deepClone(Map<QName,ComplexTypeDefinition> ctdMap, Map<QName,ComplexTypeDefinition> onThisPath, Consumer<ItemDefinition> postCloneAction)
- Specified by:
deepClone
in interfaceItemDefinition<C extends Containerable>
- Overrides:
deepClone
in classItemDefinitionImpl<PrismContainer<C extends Containerable>>
-
cloneWithReplacedDefinition
public PrismContainerDefinition<C> cloneWithReplacedDefinition(QName itemName, ItemDefinition newDefinition)
- Specified by:
cloneWithReplacedDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
replaceDefinition
public void replaceDefinition(QName itemName, ItemDefinition newDefinition)
- Specified by:
replaceDefinition
in interfacePrismContainerDefinition<C extends Containerable>
-
createPropertyDefinition
public PrismPropertyDefinitionImpl createPropertyDefinition(QName name, QName typeName)
Creates new instance of property definition and adds it to the container.This is the preferred method of creating a new definition.
- Specified by:
createPropertyDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
- Parameters:
name
- name of the property (element name)typeName
- XSD type of the property- Returns:
- created property definition
-
createPropertyDefinition
public MutablePrismPropertyDefinition<?> createPropertyDefinition(QName name, QName typeName, int minOccurs, int maxOccurs)
Creates new instance of property definition and adds it to the container.This is the preferred method of creating a new definition.
- Specified by:
createPropertyDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
- Parameters:
name
- name of the property (element name)typeName
- XSD type of the propertyminOccurs
- minimal number of occurrencesmaxOccurs
- maximal number of occurrences (-1 means unbounded)- Returns:
- created property definition
-
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(QName name)
-
createPropertyDefinition
public MutablePrismPropertyDefinition<?> createPropertyDefinition(String localName, QName typeName)
Creates new instance of property definition and adds it to the container.This is the preferred method of creating a new definition.
- Specified by:
createPropertyDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
- Parameters:
localName
- name of the property (element name) relative to the schema namespacetypeName
- XSD type of the property- Returns:
- created property definition
-
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(String localName, String localTypeName)
Creates new instance of property definition and adds it to the container.This is the preferred method of creating a new definition.
- Parameters:
localName
- name of the property (element name) relative to the schema namespacelocalTypeName
- XSD type of the property- Returns:
- created property definition
-
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(String localName, String localTypeName, int minOccurs, int maxOccurs)
Creates new instance of property definition and adds it to the container.This is the preferred method of creating a new definition.
- Parameters:
localName
- name of the property (element name) relative to the schema namespacelocalTypeName
- XSD type of the propertyminOccurs
- minimal number of occurrencesmaxOccurs
- maximal number of occurrences (-1 means unbounded)- Returns:
- created property definition
-
createContainerDefinition
public PrismContainerDefinition createContainerDefinition(QName name, QName typeName)
-
createContainerDefinition
public MutablePrismContainerDefinition<?> createContainerDefinition(QName name, QName typeName, int minOccurs, int maxOccurs)
- Specified by:
createContainerDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
-
createContainerDefinition
public MutablePrismContainerDefinition<?> createContainerDefinition(QName name, ComplexTypeDefinition complexTypeDefinition, int minOccurs, int maxOccurs)
- Specified by:
createContainerDefinition
in interfaceMutablePrismContainerDefinition<C extends Containerable>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
- Specified by:
canBeDefinitionOf
in interfaceItemDefinition<C extends Containerable>
-
canRepresent
public boolean canRepresent(@NotNull QName typeName)
- Specified by:
canRepresent
in interfacePrismContainerDefinition<C extends Containerable>
-
createValue
public PrismContainerValue<C> createValue()
- Specified by:
createValue
in interfacePrismContainerDefinition<C extends Containerable>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
- Overrides:
debugDump
in classDefinitionImpl
-
debugDump
public String debugDump(int indent, IdentityHashMap<Definition,Object> seen)
- Specified by:
debugDump
in interfaceDefinition
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrismContainerDefinition<C extends Containerable>
-
getDebugDumpClassName
public String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.- Specified by:
getDebugDumpClassName
in classDefinitionImpl
-
getDocClassName
public String getDocClassName()
Description copied from class:DefinitionImpl
Returns human-readable name of this class suitable for documentation. (e.g. "property")- Specified by:
getDocClassName
in classDefinitionImpl
-
toMutable
public MutablePrismContainerDefinition<C> toMutable()
- Specified by:
toMutable
in interfaceDefinition
- Specified by:
toMutable
in interfaceItemDefinition<C extends Containerable>
- Specified by:
toMutable
in interfacePrismContainerDefinition<C extends Containerable>
-
-