Package com.evolveum.midpoint.prism.impl
Class ComplexTypeDefinitionImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.DefinitionImpl
-
- com.evolveum.midpoint.prism.impl.TypeDefinitionImpl
-
- com.evolveum.midpoint.prism.impl.ComplexTypeDefinitionImpl
-
- All Implemented Interfaces:
ComplexTypeDefinition
,Definition
,Freezable
,LocalDefinitionStore
,MutableComplexTypeDefinition
,MutableDefinition
,MutableTypeDefinition
,PrismContextSensitive
,Revivable
,SmartVisitable<Definition>
,TypeDefinition
,Visitable<Definition>
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
ObjectClassComplexTypeDefinitionImpl
public class ComplexTypeDefinitionImpl extends TypeDefinitionImpl implements MutableComplexTypeDefinition
TODO- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
shared
-
Fields inherited from class com.evolveum.midpoint.prism.impl.TypeDefinitionImpl
compileTimeClass, instantiationOrder, serializationProxy
-
Fields inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
deprecated, deprecatedSince, displayName, displayOrder, documentation, elaborate, emphasized, experimental, help, inherited, isAbstract, isRuntimeSchema, plannedRemoval, processing, typeName
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description ComplexTypeDefinitionImpl(@NotNull QName typeName, @NotNull PrismContext prismContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(Visitor<Definition> visitor, SmartVisitation<Definition> visitation)
void
add(ItemDefinition<?> definition)
void
addSubstitution(ItemDefinition<?> itemDef, ItemDefinition<?> maybeSubst)
@NotNull ComplexTypeDefinitionImpl
clone()
Does a shallow clone of this definition (i.e.protected void
copyDefinitionData(ComplexTypeDefinitionImpl clone)
PrismPropertyDefinition
createPropertyDefinition(String localName, String localTypeName)
PrismPropertyDefinitionImpl
createPropertyDefinition(String localName, QName typeName)
PrismPropertyDefinition
createPropertyDefinition(QName name)
PrismPropertyDefinitionImpl
createPropertyDefinition(QName name, QName typeName)
String
debugDump(int indent)
String
debugDump(int indent, IdentityHashMap<Definition,Object> seen)
ComplexTypeDefinition
deepClone()
@NotNull ComplexTypeDefinition
deepClone(Map<QName,ComplexTypeDefinition> ctdMap, Map<QName,ComplexTypeDefinition> onThisPath, Consumer<ItemDefinition> postCloneAction)
Does a deep clone of this definition.void
delete(QName itemName)
boolean
equals(Object obj)
protected void
extendItemDumpDefinition(StringBuilder sb, ItemDefinition<?> def)
<ID extends ItemDefinition>
IDfindItemDefinition(@NotNull ItemPath path, @NotNull Class<ID> clazz)
<ID extends ItemDefinition>
IDfindLocalItemDefinition(@NotNull QName name)
<T extends ItemDefinition>
TfindLocalItemDefinition(@NotNull QName name, @NotNull Class<T> clazz, boolean caseInsensitive)
<ID extends ItemDefinition>
IDfindNamedItemDefinition(@NotNull QName firstName, @NotNull ItemPath rest, @NotNull Class<ID> clazz)
protected String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.String
getDefaultNamespace()
When resolving unqualified names for items contained in this CTD, what should be the default namespace to look into at first.@NotNull List<? extends ItemDefinition>
getDefinitions()
Returns set of item definitions.String
getDocClassName()
Returns human-readable name of this class suitable for documentation.QName
getExtensionForType()
If not null, indicates that this type defines the structure of 'extension' element of a given type.@NotNull List<String>
getIgnoredNamespaces()
When resolving unqualified names for items contained in this CTD, what namespace(s) should be ignored.protected String
getSchemaNamespace()
int
hashCode()
boolean
hasSubstitutions()
boolean
isContainerMarker()
Flag indicating whether this type was marked as "container" in the original schema.boolean
isEmpty()
Returns true if there are no item definitions.boolean
isListMarker()
boolean
isObjectMarker()
Flag indicating whether this type was marked as "object" in the original schema.boolean
isReferenceMarker()
Flag indicating whether this type was marked as "objectReference" in the original schema.boolean
isShared()
Is this definition shared, i.e.boolean
isXsdAnyMarker()
True if the complex type definition contains xsd:any (directly or indirectly).void
merge(ComplexTypeDefinition otherComplexTypeDef)
Merge provided definition into this definition.void
performFreeze()
void
replaceDefinition(QName itemName, ItemDefinition newDefinition)
void
revive(PrismContext prismContext)
void
setContainerMarker(boolean containerMarker)
void
setDefaultNamespace(String defaultNamespace)
void
setExtensionForType(QName extensionForType)
void
setIgnoredNamespaces(@NotNull List<String> ignoredNamespaces)
void
setListMarker(boolean listMarker)
void
setObjectMarker(boolean objectMarker)
void
setReferenceMarker(boolean referenceMarker)
void
setXsdAnyMarker(boolean xsdAnyMarker)
Optional<ItemDefinition<?>>
substitution(QName name)
MutableComplexTypeDefinition
toMutable()
void
trimTo(@NotNull Collection<ItemPath> paths)
Trims the definition (and any definitions it refers to) to contain only items related to given paths.-
Methods inherited from class com.evolveum.midpoint.prism.impl.TypeDefinitionImpl
addStaticSubType, canRepresent, copyDefinitionData, getCompileTimeClass, getInstantiationOrder, getStaticSubTypes, getSuperType, isAssignableFrom, setCompileTimeClass, setInstantiationOrder, setSuperType, useSerializationProxy, writeReplace
-
Methods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
accept, addDiagram, addSchemaMigration, checkMutableOnExposing, copyDefinitionData, extendDumpHeader, getAnnotation, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getTypeClass, getTypeClassIfKnown, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAbstract, setAnnotation, setDeprecated, setDeprecatedSince, setDisplayName, setDisplayOrder, setDocumentation, setElaborate, setEmphasized, setExperimental, setHelp, setInherited, setPlannedRemoval, setProcessing, setRuntimeSchema, setTypeName, toString
-
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.prism.ComplexTypeDefinition
containsItemDefinition, itemOrSubstitution
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Definition
getAnnotation, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getMutabilityFlag, getPlannedRemoval, getProcessing, getSchemaMigrations, getSchemaRegistry, getTypeClass, getTypeClassIfKnown, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAnnotation
-
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
-
Methods inherited from interface com.evolveum.midpoint.prism.LocalDefinitionStore
findContainerDefinition, findContainerDefinition, findItemDefinition, findPropertyDefinition, findReferenceDefinition, findReferenceDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableComplexTypeDefinition
setAbstract, setCompileTimeClass, setSuperType
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableDefinition
addDiagram, addSchemaMigration, setDeprecated, setDisplayName, setDisplayOrder, setDocumentation, setEmphasized, setExperimental, setHelp, setProcessing, setRuntimeSchema, setTypeName
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableTypeDefinition
setInstantiationOrder
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
Methods inherited from interface com.evolveum.midpoint.prism.TypeDefinition
canRepresent, getCompileTimeClass, getInstantiationOrder, getStaticSubTypes, getSuperType, isAssignableFrom
-
-
-
-
Constructor Detail
-
ComplexTypeDefinitionImpl
public ComplexTypeDefinitionImpl(@NotNull @NotNull QName typeName, @NotNull @NotNull PrismContext prismContext)
-
-
Method Detail
-
getSchemaNamespace
protected String getSchemaNamespace()
-
getDefinitions
@NotNull public @NotNull List<? extends ItemDefinition> getDefinitions()
Returns set of item definitions. The set contains all item definitions of all types that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitions
in interfaceComplexTypeDefinition
- Returns:
- set of definitions
-
add
public void add(ItemDefinition<?> definition)
- Specified by:
add
in interfaceMutableComplexTypeDefinition
-
isShared
public boolean isShared()
Description copied from interface:ComplexTypeDefinition
Is this definition shared, i.e. used by more than one prism object? If so, it should not be e.g. trimmed. EXPERIMENTAL- Specified by:
isShared
in interfaceComplexTypeDefinition
-
getExtensionForType
public QName getExtensionForType()
Description copied from interface:ComplexTypeDefinition
If not null, indicates that this type defines the structure of 'extension' element of a given type. E.g. getExtensionForType() == c:UserType means that this complex type defines structure of 'extension' elements of UserType objects.- Specified by:
getExtensionForType
in interfaceComplexTypeDefinition
-
setExtensionForType
public void setExtensionForType(QName extensionForType)
- Specified by:
setExtensionForType
in interfaceMutableComplexTypeDefinition
-
isReferenceMarker
public boolean isReferenceMarker()
Description copied from interface:ComplexTypeDefinition
Flag indicating whether this type was marked as "objectReference" in the original schema.- Specified by:
isReferenceMarker
in interfaceComplexTypeDefinition
-
setReferenceMarker
public void setReferenceMarker(boolean referenceMarker)
- Specified by:
setReferenceMarker
in interfaceMutableComplexTypeDefinition
-
isContainerMarker
public boolean isContainerMarker()
Description copied from interface:ComplexTypeDefinition
Flag indicating whether this type was marked as "container" in the original schema. Does not provide any information to schema processing logic, just conveys the marker from original schema so we can serialize and deserialize the schema without loss of information.- Specified by:
isContainerMarker
in interfaceComplexTypeDefinition
-
setContainerMarker
public void setContainerMarker(boolean containerMarker)
- Specified by:
setContainerMarker
in interfaceMutableComplexTypeDefinition
-
isObjectMarker
public boolean isObjectMarker()
Description copied from interface:ComplexTypeDefinition
Flag indicating whether this type was marked as "object" in the original schema. Does not provide any information to schema processing logic, just conveys the marker from original schema so we can serialized and deserialize the schema without loss of information.- Specified by:
isObjectMarker
in interfaceComplexTypeDefinition
-
isXsdAnyMarker
public boolean isXsdAnyMarker()
Description copied from interface:ComplexTypeDefinition
True if the complex type definition contains xsd:any (directly or indirectly).- Specified by:
isXsdAnyMarker
in interfaceComplexTypeDefinition
-
setXsdAnyMarker
public void setXsdAnyMarker(boolean xsdAnyMarker)
- Specified by:
setXsdAnyMarker
in interfaceMutableComplexTypeDefinition
-
isListMarker
public boolean isListMarker()
- Specified by:
isListMarker
in interfaceComplexTypeDefinition
-
setListMarker
public void setListMarker(boolean listMarker)
- Specified by:
setListMarker
in interfaceMutableComplexTypeDefinition
-
getDefaultNamespace
public String getDefaultNamespace()
Description copied from interface:ComplexTypeDefinition
When resolving unqualified names for items contained in this CTD, what should be the default namespace to look into at first. Currently does NOT apply recursively (to inner CTDs).- Specified by:
getDefaultNamespace
in interfaceComplexTypeDefinition
-
setDefaultNamespace
public void setDefaultNamespace(String defaultNamespace)
- Specified by:
setDefaultNamespace
in interfaceMutableComplexTypeDefinition
-
getIgnoredNamespaces
@NotNull public @NotNull List<String> getIgnoredNamespaces()
Description copied from interface:ComplexTypeDefinition
When resolving unqualified names for items contained in this CTD, what namespace(s) should be ignored. Names in this list are interpreted as a namespace prefixes. Currently does NOT apply recursively (to inner CTDs).- Specified by:
getIgnoredNamespaces
in interfaceComplexTypeDefinition
-
setIgnoredNamespaces
public void setIgnoredNamespaces(@NotNull @NotNull List<String> ignoredNamespaces)
- Specified by:
setIgnoredNamespaces
in interfaceMutableComplexTypeDefinition
-
setObjectMarker
public void setObjectMarker(boolean objectMarker)
- Specified by:
setObjectMarker
in interfaceMutableComplexTypeDefinition
-
createPropertyDefinition
public PrismPropertyDefinitionImpl createPropertyDefinition(QName name, QName typeName)
- Specified by:
createPropertyDefinition
in interfaceMutableComplexTypeDefinition
-
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(QName name)
-
createPropertyDefinition
public PrismPropertyDefinitionImpl createPropertyDefinition(String localName, QName typeName)
- Specified by:
createPropertyDefinition
in interfaceMutableComplexTypeDefinition
-
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(String localName, String localTypeName)
-
findLocalItemDefinition
public <ID extends ItemDefinition> ID findLocalItemDefinition(@NotNull @NotNull QName name)
- Specified by:
findLocalItemDefinition
in interfaceLocalDefinitionStore
-
findLocalItemDefinition
public <T extends ItemDefinition> T findLocalItemDefinition(@NotNull @NotNull QName name, @NotNull @NotNull Class<T> clazz, boolean caseInsensitive)
- Specified by:
findLocalItemDefinition
in interfaceLocalDefinitionStore
-
findItemDefinition
public <ID extends ItemDefinition> ID findItemDefinition(@NotNull @NotNull ItemPath path, @NotNull @NotNull Class<ID> clazz)
- Specified by:
findItemDefinition
in interfaceLocalDefinitionStore
-
findNamedItemDefinition
public <ID extends ItemDefinition> ID findNamedItemDefinition(@NotNull @NotNull QName firstName, @NotNull @NotNull ItemPath rest, @NotNull @NotNull Class<ID> clazz)
- Specified by:
findNamedItemDefinition
in interfaceLocalDefinitionStore
-
merge
public void merge(ComplexTypeDefinition otherComplexTypeDef)
Merge provided definition into this definition.- Specified by:
merge
in interfaceComplexTypeDefinition
-
revive
public void revive(PrismContext prismContext)
- Specified by:
revive
in interfaceComplexTypeDefinition
- Specified by:
revive
in interfaceRevivable
- Specified by:
revive
in classDefinitionImpl
-
isEmpty
public boolean isEmpty()
Description copied from interface:ComplexTypeDefinition
Returns true if there are no item definitions.- Specified by:
isEmpty
in interfaceComplexTypeDefinition
-
accept
public boolean accept(Visitor<Definition> visitor, SmartVisitation<Definition> visitation)
- Specified by:
accept
in interfaceSmartVisitable<Definition>
- Overrides:
accept
in classDefinitionImpl
- Returns:
- false if we already was here
-
clone
@NotNull public @NotNull ComplexTypeDefinitionImpl clone()
Description copied from interface:ComplexTypeDefinition
Does a shallow clone of this definition (i.e. item definitions themselves are NOT cloned).- Specified by:
clone
in interfaceComplexTypeDefinition
- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceMutableComplexTypeDefinition
- Specified by:
clone
in classDefinitionImpl
-
deepClone
public ComplexTypeDefinition deepClone()
-
deepClone
@NotNull public @NotNull ComplexTypeDefinition deepClone(Map<QName,ComplexTypeDefinition> ctdMap, Map<QName,ComplexTypeDefinition> onThisPath, Consumer<ItemDefinition> postCloneAction)
Description copied from interface:ComplexTypeDefinition
Does a deep clone of this definition.- Specified by:
deepClone
in interfaceComplexTypeDefinition
- Parameters:
ctdMap
- Keeps already cloned definitions when 'ultra deep cloning' is not requested. Each definition is then cloned only once.onThisPath
- Keeps already cloned definitions on the path from root to current node; in order to prevent infinite loops when doing ultra deep cloning.
-
copyDefinitionData
protected void copyDefinitionData(ComplexTypeDefinitionImpl clone)
-
replaceDefinition
public void replaceDefinition(QName itemName, ItemDefinition newDefinition)
- Specified by:
replaceDefinition
in interfaceMutableComplexTypeDefinition
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTypeDefinitionImpl
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classTypeDefinitionImpl
-
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
-
extendItemDumpDefinition
protected void extendItemDumpDefinition(StringBuilder sb, ItemDefinition<?> def)
-
getDebugDumpClassName
protected 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
-
trimTo
public void trimTo(@NotNull @NotNull Collection<ItemPath> paths)
Description copied from interface:ComplexTypeDefinition
Trims the definition (and any definitions it refers to) to contain only items related to given paths. USE WITH CARE. Be sure no shared definitions would be affected by this operation!- Specified by:
trimTo
in interfaceComplexTypeDefinition
-
delete
public void delete(QName itemName)
- Specified by:
delete
in interfaceMutableComplexTypeDefinition
-
toMutable
public MutableComplexTypeDefinition toMutable()
- Specified by:
toMutable
in interfaceComplexTypeDefinition
- Specified by:
toMutable
in interfaceDefinition
-
performFreeze
public void performFreeze()
- Overrides:
performFreeze
in classAbstractFreezable
-
addSubstitution
public void addSubstitution(ItemDefinition<?> itemDef, ItemDefinition<?> maybeSubst)
- Specified by:
addSubstitution
in interfaceMutableComplexTypeDefinition
-
substitution
public Optional<ItemDefinition<?>> substitution(QName name)
- Specified by:
substitution
in interfaceComplexTypeDefinition
-
hasSubstitutions
public boolean hasSubstitutions()
- Specified by:
hasSubstitutions
in interfaceComplexTypeDefinition
-
-