Package com.evolveum.midpoint.prism.impl
Class PrismReferenceDefinitionImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.DefinitionImpl
com.evolveum.midpoint.prism.impl.ItemDefinitionImpl<PrismReference>
com.evolveum.midpoint.prism.impl.PrismReferenceDefinitionImpl
- All Implemented Interfaces:
Definition
,Freezable
,ItemDefinition<PrismReference>
,ItemDefinitionTestAccess
,MutableDefinition
,MutableItemDefinition<PrismReference>
,MutablePrismReferenceDefinition
,PrismContextSensitive
,PrismItemAccessDefinition
,PrismReferenceDefinition
,Revivable
,SmartVisitable<Definition>
,Visitable<Definition>
,DebugDumpable
,Serializable
,Cloneable
public class PrismReferenceDefinitionImpl
extends ItemDefinitionImpl<PrismReference>
implements MutablePrismReferenceDefinition
Object Reference Schema Definition.
Object Reference is a property that describes reference to an object. It is
used to represent association between objects. For example reference from
User object to Account objects that belong to the user. The reference is a
simple uni-directional link using an OID as an identifier.
This type should be used for all object references so the implementations can
detect them and automatically resolve them.
This class represents schema definition for object reference. See
Definition
for more details.- Author:
- Radovan Semancik
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismItemAccessDefinition
PrismItemAccessDefinition.Mutable
-
Field Summary
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, processing, removed, removedSince, typeName
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ConstructorDescriptionPrismReferenceDefinitionImpl
(QName elementName, QName typeName) PrismReferenceDefinitionImpl
(QName elementName, QName typeName, QName definedInType) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canBeDefinitionOf
(PrismValue pvalue) TODO document@NotNull PrismReferenceDefinition
clone()
protected void
@NotNull ItemDelta
createEmptyDelta
(ItemPath path) Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.protected void
<T extends ItemDefinition<?>>
TfindItemDefinition
(@NotNull ItemPath path, @NotNull Class<T> clazz) Used to find a matching item definition _within_ this definition.Return a human readable name of this class suitable for logs.Returns human-readable name of this class suitable for documentation.Returns valid XSD object types whose may be the targets of the reference.Returns a compile-time class that is used to represent items.@NotNull PrismReference
Create an item instance.@NotNull PrismReference
instantiate
(QName name) Create an item instance.boolean
boolean
isValidFor
(@NotNull QName elementQName, @NotNull Class<? extends ItemDefinition<?>> clazz, boolean caseInsensitive) Returns true if this definition is valid for given element name and definition class, in either case-sensitive (the default) or case-insensitive way.void
setComposite
(boolean isComposite) void
setCompositeObjectElementName
(QName compositeObjectElementName) void
setTargetTypeName
(QName targetTypeName) Returns complex type definition of item, if underlying value is possible structured.Returns an interface to mutate this definition.Methods inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, copyDefinitionDataFrom, debugDumpShortToString, debugFlags, debugMultiplicity, deepClone, equals, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, hashCode, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isOperational, isSearchable, replaceName, revive, setCanAdd, setCanModify, setCanRead, setDynamic, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setReadOnly, setSearchable, setSubstitutionHead, setValueEnumerationRef, toString, useSerializationProxy, writeReplace
Methods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
accept, accept, addDiagram, addSchemaMigration, checkMutableOnExposing, copyDefinitionDataFrom, debugDump, extendDumpHeader, getAnnotation, getAnnotations, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getRemovedSince, getSchemaMigrations, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRemoved, isRuntimeSchema, setAbstract, setAnnotation, setDeprecated, setDeprecatedSince, setDisplayName, setDisplayOrder, setDocumentation, setElaborate, setEmphasized, setExperimental, setHelp, setPlannedRemoval, setProcessing, setRemoved, setRemovedSince, setRuntimeSchema, setTypeName
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable, performFreeze
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Definition
debugDump, getAnnotation, getAnnotations, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getMutabilityFlag, getPlannedRemoval, getProcessing, getRemovedSince, getSchemaMigrations, getSchemaRegistry, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRemoved, isRuntimeSchema, setAnnotation
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
adoptElementDefinitionFrom, canBeDefinitionOf, debugDumpShortToString, deepClone, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSearchable, isSingleValue
Methods inherited from interface com.evolveum.midpoint.prism.MutableDefinition
addDiagram, addSchemaMigration, setDeprecated, setDisplayName, setDisplayOrder, setDocumentation, setEmphasized, setExperimental, setHelp, setProcessing, setRemoved, setRemovedSince, setRuntimeSchema, setTypeName
Methods inherited from interface com.evolveum.midpoint.prism.MutableItemDefinition
setCanAdd, setCanModify, setCanRead, setDeprecatedSince, setDynamic, setElaborate, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setReadOnly, setSearchable, setSubstitutionHead, setValueEnumerationRef
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
Methods inherited from interface com.evolveum.midpoint.prism.PrismItemAccessDefinition
canAdd, canModify, canRead
Methods inherited from interface com.evolveum.midpoint.prism.SmartVisitable
accept
-
Constructor Details
-
PrismReferenceDefinitionImpl
-
PrismReferenceDefinitionImpl
-
-
Method Details
-
getTargetTypeName
Returns valid XSD object types whose may be the targets of the reference. Corresponds to "targetType" XSD annotation. Returns empty set if not specified. Must not return null.- Specified by:
getTargetTypeName
in interfacePrismReferenceDefinition
- Returns:
- set of target type names
-
setTargetTypeName
- Specified by:
setTargetTypeName
in interfaceMutablePrismReferenceDefinition
-
getCompositeObjectElementName
- Specified by:
getCompositeObjectElementName
in interfacePrismReferenceDefinition
-
setCompositeObjectElementName
-
isComposite
public boolean isComposite()- Specified by:
isComposite
in interfacePrismReferenceDefinition
-
setComposite
public void setComposite(boolean isComposite) - Specified by:
setComposite
in interfaceMutablePrismReferenceDefinition
-
isValidFor
public boolean isValidFor(@NotNull @NotNull QName elementQName, @NotNull @NotNull Class<? extends ItemDefinition<?>> clazz, boolean caseInsensitive) Description copied from interface:ItemDefinition
Returns true if this definition is valid for given element name and definition class, in either case-sensitive (the default) or case-insensitive way. Used e.g. for "slow" path lookup where we iterate over all definitions in a complex type.- Specified by:
isValidFor
in interfaceItemDefinition<PrismReference>
- Overrides:
isValidFor
in classItemDefinitionImpl<PrismReference>
-
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 interfaceItemDefinition<PrismReference>
- Overrides:
findItemDefinition
in classItemDefinitionImpl<PrismReference>
-
instantiate
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<PrismReference>
- Specified by:
instantiate
in interfacePrismReferenceDefinition
-
instantiate
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<PrismReference>
- Specified by:
instantiate
in interfacePrismReferenceDefinition
-
createEmptyDelta
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 interfaceItemDefinition<PrismReference>
-
canBeDefinitionOf
Description copied from interface:ItemDefinition
TODO document- Specified by:
canBeDefinitionOf
in interfaceItemDefinition<PrismReference>
-
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 interfaceDefinition
- Overrides:
getTypeClass
in classDefinitionImpl
-
toMutable
Description copied from interface:Definition
Returns an interface to mutate this definition.- Specified by:
toMutable
in interfaceDefinition
- Specified by:
toMutable
in interfaceItemDefinition<PrismReference>
-
clone
- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<PrismReference>
- Specified by:
clone
in interfacePrismReferenceDefinition
- Specified by:
clone
in classItemDefinitionImpl<PrismReference>
-
copyDefinitionDataFrom
-
getDebugDumpClassName
Return a human readable name of this class suitable for logs.- Specified by:
getDebugDumpClassName
in classDefinitionImpl
-
getDocClassName
Description copied from class:DefinitionImpl
Returns human-readable name of this class suitable for documentation. (e.g. "property")- Specified by:
getDocClassName
in classDefinitionImpl
-
extendToString
- Overrides:
extendToString
in classItemDefinitionImpl<PrismReference>
-
structuredType
Description copied from interface:ItemDefinition
Returns complex type definition of item, if underlying value is possible structured. NOTE: This seems weird, since properties and references are simple values, but actually object reference is serialized as structured value and some of properties are also.- Specified by:
structuredType
in interfaceItemDefinition<PrismReference>
-