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. SeeDefinition
for more details.- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
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, typeName
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismReferenceDefinitionImpl(QName elementName, QName typeName)
PrismReferenceDefinitionImpl(QName elementName, QName typeName, QName definedInType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeDefinitionOf(PrismValue pvalue)
TODO document@NotNull PrismReferenceDefinition
clone()
protected void
copyDefinitionDataFrom(PrismReferenceDefinition source)
@NotNull ItemDelta
createEmptyDelta(ItemPath path)
Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.protected void
extendToString(StringBuilder sb)
<T extends ItemDefinition<?>>
TfindItemDefinition(@NotNull ItemPath path, @NotNull Class<T> clazz)
Used to find a matching item definition _within_ this definition.QName
getCompositeObjectElementName()
String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.String
getDocClassName()
Returns human-readable name of this class suitable for documentation.QName
getTargetTypeName()
Returns valid XSD object types whose may be the targets of the reference.Class
getTypeClass()
Returns a compile-time class that is used to represent items.@NotNull PrismReference
instantiate()
Create an item instance.@NotNull PrismReference
instantiate(QName name)
Create an item instance.boolean
isComposite()
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)
Optional<ComplexTypeDefinition>
structuredType()
Returns complex type definition of item, if underlying value is possible structured.MutablePrismReferenceDefinition
toMutable()
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, replaceName, revive, setCanAdd, setCanModify, setCanRead, setDynamic, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setReadOnly, 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, getSchemaMigrations, getTypeName, isAbstract, 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 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, getSchemaMigrations, getSchemaRegistry, 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.ItemDefinition
adoptElementDefinitionFrom, canBeDefinitionOf, debugDumpShortToString, deepClone, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue
-
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.MutableItemDefinition
setCanAdd, setCanModify, setCanRead, setDeprecatedSince, setDynamic, setElaborate, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setReadOnly, 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
-
-
-
-
Method Detail
-
getTargetTypeName
public QName 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
public void setTargetTypeName(QName targetTypeName)
- Specified by:
setTargetTypeName
in interfaceMutablePrismReferenceDefinition
-
getCompositeObjectElementName
public QName getCompositeObjectElementName()
- Specified by:
getCompositeObjectElementName
in interfacePrismReferenceDefinition
-
setCompositeObjectElementName
public void setCompositeObjectElementName(QName compositeObjectElementName)
-
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
@NotNull public @NotNull 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
@NotNull public @NotNull PrismReference instantiate(QName name)
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
@NotNull public @NotNull ItemDelta 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 interfaceItemDefinition<PrismReference>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
Description copied from interface:ItemDefinition
TODO document- Specified by:
canBeDefinitionOf
in interfaceItemDefinition<PrismReference>
-
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 interfaceDefinition
- Overrides:
getTypeClass
in classDefinitionImpl
-
toMutable
public MutablePrismReferenceDefinition 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
@NotNull public @NotNull PrismReferenceDefinition clone()
- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<PrismReference>
- Specified by:
clone
in interfacePrismReferenceDefinition
- Specified by:
clone
in classItemDefinitionImpl<PrismReference>
-
copyDefinitionDataFrom
protected void copyDefinitionDataFrom(PrismReferenceDefinition source)
-
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
-
extendToString
protected void extendToString(StringBuilder sb)
- Overrides:
extendToString
in classItemDefinitionImpl<PrismReference>
-
structuredType
public Optional<ComplexTypeDefinition> 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>
-
-