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. SeeDefinitionfor 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 booleancanBeDefinitionOf(PrismValue pvalue)TODO document@NotNull PrismReferenceDefinitionclone()protected voidcopyDefinitionDataFrom(PrismReferenceDefinition source)@NotNull ItemDeltacreateEmptyDelta(ItemPath path)Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.protected voidextendToString(StringBuilder sb)<T extends ItemDefinition<?>>
TfindItemDefinition(@NotNull ItemPath path, @NotNull Class<T> clazz)Used to find a matching item definition _within_ this definition.QNamegetCompositeObjectElementName()StringgetDebugDumpClassName()Return a human readable name of this class suitable for logs.StringgetDocClassName()Returns human-readable name of this class suitable for documentation.QNamegetTargetTypeName()Returns valid XSD object types whose may be the targets of the reference.ClassgetTypeClass()Returns a compile-time class that is used to represent items.@NotNull PrismReferenceinstantiate()Create an item instance.@NotNull PrismReferenceinstantiate(QName name)Create an item instance.booleanisComposite()booleanisValidFor(@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.voidsetComposite(boolean isComposite)voidsetCompositeObjectElementName(QName compositeObjectElementName)voidsetTargetTypeName(QName targetTypeName)Optional<ComplexTypeDefinition>structuredType()Returns complex type definition of item, if underlying value is possible structured.MutablePrismReferenceDefinitiontoMutable()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:
getTargetTypeNamein interfacePrismReferenceDefinition- Returns:
- set of target type names
-
setTargetTypeName
public void setTargetTypeName(QName targetTypeName)
- Specified by:
setTargetTypeNamein interfaceMutablePrismReferenceDefinition
-
getCompositeObjectElementName
public QName getCompositeObjectElementName()
- Specified by:
getCompositeObjectElementNamein interfacePrismReferenceDefinition
-
setCompositeObjectElementName
public void setCompositeObjectElementName(QName compositeObjectElementName)
-
isComposite
public boolean isComposite()
- Specified by:
isCompositein interfacePrismReferenceDefinition
-
setComposite
public void setComposite(boolean isComposite)
- Specified by:
setCompositein interfaceMutablePrismReferenceDefinition
-
isValidFor
public boolean isValidFor(@NotNull @NotNull QName elementQName, @NotNull @NotNull Class<? extends ItemDefinition<?>> clazz, boolean caseInsensitive)Description copied from interface:ItemDefinitionReturns 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:
isValidForin interfaceItemDefinition<PrismReference>- Overrides:
isValidForin classItemDefinitionImpl<PrismReference>
-
findItemDefinition
public <T extends ItemDefinition<?>> T findItemDefinition(@NotNull @NotNull ItemPath path, @NotNull @NotNull Class<T> clazz)
Description copied from interface:ItemDefinitionUsed to find a matching item definition _within_ this definition. Treats e.g. de-referencing in prism references.- Specified by:
findItemDefinitionin interfaceItemDefinition<PrismReference>- Overrides:
findItemDefinitionin classItemDefinitionImpl<PrismReference>
-
instantiate
@NotNull public @NotNull PrismReference instantiate()
Description copied from interface:ItemDefinitionCreate 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:
instantiatein interfaceItemDefinition<PrismReference>- Specified by:
instantiatein interfacePrismReferenceDefinition
-
instantiate
@NotNull public @NotNull PrismReference instantiate(QName name)
Description copied from interface:ItemDefinitionCreate an item instance. Definition name will use provided name. for the instance. The instance will otherwise be empty.- Specified by:
instantiatein interfaceItemDefinition<PrismReference>- Specified by:
instantiatein interfacePrismReferenceDefinition
-
createEmptyDelta
@NotNull public @NotNull ItemDelta createEmptyDelta(ItemPath path)
Description copied from interface:ItemDefinitionCreates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.- Specified by:
createEmptyDeltain interfaceItemDefinition<PrismReference>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
Description copied from interface:ItemDefinitionTODO document- Specified by:
canBeDefinitionOfin interfaceItemDefinition<PrismReference>
-
getTypeClass
public Class getTypeClass()
Description copied from interface:DefinitionReturns 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:
getTypeClassin interfaceDefinition- Overrides:
getTypeClassin classDefinitionImpl
-
toMutable
public MutablePrismReferenceDefinition toMutable()
Description copied from interface:DefinitionReturns an interface to mutate this definition.- Specified by:
toMutablein interfaceDefinition- Specified by:
toMutablein interfaceItemDefinition<PrismReference>
-
clone
@NotNull public @NotNull PrismReferenceDefinition clone()
- Specified by:
clonein interfaceDefinition- Specified by:
clonein interfaceItemDefinition<PrismReference>- Specified by:
clonein interfacePrismReferenceDefinition- Specified by:
clonein 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:
getDebugDumpClassNamein classDefinitionImpl
-
getDocClassName
public String getDocClassName()
Description copied from class:DefinitionImplReturns human-readable name of this class suitable for documentation. (e.g. "property")- Specified by:
getDocClassNamein classDefinitionImpl
-
extendToString
protected void extendToString(StringBuilder sb)
- Overrides:
extendToStringin classItemDefinitionImpl<PrismReference>
-
structuredType
public Optional<ComplexTypeDefinition> structuredType()
Description copied from interface:ItemDefinitionReturns 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:
structuredTypein interfaceItemDefinition<PrismReference>
-
-