Package com.evolveum.midpoint.prism.impl
Class ItemDefinitionImpl<I extends Item<?,?>>
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.DefinitionImpl
com.evolveum.midpoint.prism.impl.ItemDefinitionImpl<I>
- All Implemented Interfaces:
Definition,Freezable,ItemDefinition<I>,ItemDefinitionTestAccess,MutableDefinition,MutableItemDefinition<I>,PrismContextSensitive,PrismItemAccessDefinition,Revivable,SmartVisitable<Definition>,Visitable<Definition>,DebugDumpable,Serializable,Cloneable
- Direct Known Subclasses:
PrismContainerDefinitionImpl,PrismPropertyDefinitionImpl,PrismReferenceDefinitionImpl
public abstract class ItemDefinitionImpl<I extends Item<?,?>>
extends DefinitionImpl
implements MutableItemDefinition<I>, ItemDefinitionTestAccess
Abstract item definition in the schema.
This is supposed to be a superclass for all item definitions. Items are things
that can appear in property containers, which generally means only a property
and property container itself. Therefore this is in fact superclass for those
two definitions.
The definitions represent data structures of the schema. Therefore instances
of Java objects from this class represent specific definitions from
the schema, not specific properties or objects. E.g the definitions does not
have any value.
To transform definition to a real property or object use the explicit
instantiate() methods provided in the definition classes. E.g. the
instantiate() method will create instance of Property using appropriate
PropertyDefinition.
The convenience methods in Schema are using this abstract class to find
appropriate definitions easily.
- Author:
- Radovan Semancik
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismItemAccessDefinition
PrismItemAccessDefinition.Mutable -
Field Summary
FieldsFields inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
deprecated, deprecatedSince, displayName, displayOrder, documentation, elaborate, emphasized, experimental, help, isAbstract, isRuntimeSchema, plannedRemoval, processing, removed, removedSince, typeNameFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Method Summary
Modifier and TypeMethodDescriptionvoidadoptElementDefinitionFrom(ItemDefinition<?> otherDef) Transfers selected parts of the definition (currently item name, min/max occurs) from another definition.booleancanAdd()Returns true if the item can be added.booleancanBeDefinitionOf(I item) TODO documentbooleanReturns true if the item can be modified.booleancanRead()Returns true if the property can be read.abstract @NotNull ItemDefinition<I>clone()protected voidcopyDefinitionDataFrom(ItemDefinition<I> source) voidUsed in debugDumping items.deepClone(@NotNull DeepCloneOperation operation) Make a deep clone, cloning all the sub-items and definitions.booleanprotected void<T extends ItemDefinition<?>>
TfindItemDefinition(@NotNull ItemPath path, @NotNull Class<T> clazz) Used to find a matching item definition _within_ this definition.@NotNull ItemNameReturns name of the defined entity.intReturn the number of maximal value occurrences.intReturn the number of minimal value occurrences.Returns the name of an element this one can be substituted for (e.g.Reference to an object that directly or indirectly represents possible values for this item.inthashCode()booleanReturns true if definition was created during the runtime based on a dynamic information such as xsi:type attributes in XML.booleanCan be used in heterogeneous lists as a list item.booleanIf true, this item is not stored in XML representation in repo.booleanWhether the item is inherited from a supertype.booleanMarks operational item.booleanReturns true if item definition is searchable.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.voidreplaceName(ItemName newName) voidrevive(PrismContext prismContext) TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)voidsetCanAdd(boolean add) voidsetCanModify(boolean modify) voidsetCanRead(boolean read) voidsetDynamic(boolean dynamic) voidsetHeterogeneousListItem(boolean heterogeneousListItem) voidsetIndexOnly(boolean indexOnly) voidsetInherited(boolean inherited) voidsetItemName(@NotNull QName name) voidsetMaxOccurs(int maxOccurs) voidsetMinOccurs(int minOccurs) voidsetOperational(boolean operational) voidvoidsetSearchable(boolean searchable) voidsetSubstitutionHead(QName substitutionHead) voidsetValueEnumerationRef(PrismReferenceValue valueEnumerationRef) toString()protected static booleanuseSerializationProxy(boolean localEnabled) protected ObjectMethods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
accept, accept, addDiagram, addSchemaMigration, checkMutableOnExposing, copyDefinitionDataFrom, debugDump, extendDumpHeader, getAnnotation, getAnnotations, getDebugDumpClassName, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocClassName, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getRemovedSince, getSchemaMigrations, getTypeClass, 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, setTypeNameMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable, performFreezeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Definition
debugDump, getAnnotation, getAnnotations, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getMutabilityFlag, getPlannedRemoval, getProcessing, getRemovedSince, getSchemaMigrations, getSchemaRegistry, getTypeClass, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRemoved, isRuntimeSchema, setAnnotationMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
canBeDefinitionOf, createEmptyDelta, instantiate, instantiate, isMandatory, isMultiValue, isOptional, isSingleValue, structuredType, toMutableMethods inherited from interface com.evolveum.midpoint.prism.MutableDefinition
addDiagram, addSchemaMigration, setDeprecated, setDisplayName, setDisplayOrder, setDocumentation, setEmphasized, setExperimental, setHelp, setProcessing, setRemoved, setRemovedSince, setRuntimeSchema, setTypeNameMethods inherited from interface com.evolveum.midpoint.prism.MutableItemDefinition
setDeprecatedSince, setElaborate, setPlannedRemovalMethods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContextMethods inherited from interface com.evolveum.midpoint.prism.SmartVisitable
accept
-
Field Details
-
itemName
-
substitutionHead
-
heterogeneousListItem
protected boolean heterogeneousListItem
-
-
Method Details
-
useSerializationProxy
protected static boolean useSerializationProxy(boolean localEnabled) -
getItemName
Returns name of the defined entity. The name is a name of the entity instance if it is fixed by the schema. E.g. it may be a name of the property in the container that cannot be changed. The name corresponds to the XML element name in the XML representation of the schema. It does NOT correspond to a XSD type name. Name is optional. If name is not set the null value is returned. If name is not set the type is "abstract", does not correspond to the element.- Specified by:
getItemNamein interfaceItemDefinition<I extends Item<?,?>> - Returns:
- the name name of the entity or null.
-
setItemName
- Specified by:
setItemNamein interfaceMutableItemDefinition<I extends Item<?,?>>
-
getMinOccurs
public int getMinOccurs()Description copied from interface:ItemDefinitionReturn the number of minimal value occurrences.- Specified by:
getMinOccursin interfaceItemDefinition<I extends Item<?,?>>
-
setMinOccurs
public void setMinOccurs(int minOccurs) - Specified by:
setMinOccursin interfaceMutableItemDefinition<I extends Item<?,?>>
-
getMaxOccurs
public int getMaxOccurs()Description copied from interface:ItemDefinitionReturn the number of maximal value occurrences. Any negative number means "unbounded".- Specified by:
getMaxOccursin interfaceItemDefinition<I extends Item<?,?>>
-
setMaxOccurs
public void setMaxOccurs(int maxOccurs) - Specified by:
setMaxOccursin interfaceMutableItemDefinition<I extends Item<?,?>>
-
isOperational
public boolean isOperational()Description copied from interface:ItemDefinitionMarks operational item. Operational properties are auxiliary data (or meta-data) that are usually not modifiable by the end user. They are generated and maintained by the system. Operational items are also not usually displayed unless it is explicitly requested. The example of operational items are modification timestamps, create timestamps, user that made the last change, etc. They are also treated in a special way when comparing values. SeeParameterizedEquivalenceStrategy.- Specified by:
isOperationalin interfaceItemDefinition<I extends Item<?,?>>
-
setOperational
public void setOperational(boolean operational) - Specified by:
setOperationalin interfaceMutableItemDefinition<I extends Item<?,?>>
-
isDynamic
public boolean isDynamic()Description copied from interface:ItemDefinitionReturns true if definition was created during the runtime based on a dynamic information such as xsi:type attributes in XML. This means that the definition needs to be stored alongside the data to have a successful serialization "roundtrip". The definition is not part of any schema and therefore cannot be determined. It may even be different for every instance of the associated item (element name).- Specified by:
isDynamicin interfaceItemDefinition<I extends Item<?,?>>
-
setDynamic
public void setDynamic(boolean dynamic) - Specified by:
setDynamicin interfaceMutableItemDefinition<I extends Item<?,?>>
-
canRead
public boolean canRead()Returns true if the property can be read. I.e. if it is returned in objects retrieved from "get", "search" and similar operations.- Specified by:
canReadin interfacePrismItemAccessDefinition
-
canModify
public boolean canModify()Returns true if the item can be modified. I.e. if it can be changed during a modification of existing object.- Specified by:
canModifyin interfacePrismItemAccessDefinition
-
setReadOnly
public void setReadOnly()- Specified by:
setReadOnlyin interfaceMutableItemDefinition<I extends Item<?,?>>
-
setCanRead
public void setCanRead(boolean read) - Specified by:
setCanReadin interfaceMutableItemDefinition<I extends Item<?,?>>
-
setCanModify
public void setCanModify(boolean modify) - Specified by:
setCanModifyin interfaceMutableItemDefinition<I extends Item<?,?>>
-
setCanAdd
public void setCanAdd(boolean add) - Specified by:
setCanAddin interfaceMutableItemDefinition<I extends Item<?,?>>
-
canAdd
public boolean canAdd()Returns true if the item can be added. I.e. if it can be present in the object when a new object is created.- Specified by:
canAddin interfacePrismItemAccessDefinition
-
getSubstitutionHead
Description copied from interface:ItemDefinitionReturns the name of an element this one can be substituted for (e.g. c:user -> c:object, s:pipeline -> s:expression, etc). EXPERIMENTAL- Specified by:
getSubstitutionHeadin interfaceItemDefinition<I extends Item<?,?>>
-
setSubstitutionHead
- Specified by:
setSubstitutionHeadin interfaceMutableItemDefinition<I extends Item<?,?>>
-
isHeterogeneousListItem
public boolean isHeterogeneousListItem()Description copied from interface:ItemDefinitionCan be used in heterogeneous lists as a list item. EXPERIMENTAL.- Specified by:
isHeterogeneousListItemin interfaceItemDefinition<I extends Item<?,?>>
-
setHeterogeneousListItem
public void setHeterogeneousListItem(boolean heterogeneousListItem) - Specified by:
setHeterogeneousListItemin interfaceMutableItemDefinition<I extends Item<?,?>>
-
getValueEnumerationRef
Description copied from interface:ItemDefinitionReference to an object that directly or indirectly represents possible values for this item. We do not define here what exactly the object has to be. It can be a lookup table, script that dynamically produces the values or anything similar. The object must produce the values of the correct type for this item otherwise an error occurs.- Specified by:
getValueEnumerationRefin interfaceItemDefinition<I extends Item<?,?>>
-
setValueEnumerationRef
- Specified by:
setValueEnumerationRefin interfaceMutableItemDefinition<I extends Item<?,?>>
-
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<I extends Item<?,?>>
-
adoptElementDefinitionFrom
Description copied from interface:ItemDefinitionTransfers selected parts of the definition (currently item name, min/max occurs) from another definition. TODO used only on few places, consider removing- Specified by:
adoptElementDefinitionFromin interfaceItemDefinition<I extends Item<?,?>>
-
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<I extends Item<?,?>>
-
canBeDefinitionOf
Description copied from interface:ItemDefinitionTODO document- Specified by:
canBeDefinitionOfin interfaceItemDefinition<I extends Item<?,?>>
-
clone
- Specified by:
clonein interfaceDefinition- Specified by:
clonein interfaceItemDefinition<I extends Item<?,?>> - Specified by:
clonein classDefinitionImpl
-
copyDefinitionDataFrom
-
deepClone
Make a deep clone, cloning all the sub-items and definitions.- Specified by:
deepClonein interfaceItemDefinition<I extends Item<?,?>>
-
revive
Description copied from interface:RevivableTODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)- Specified by:
revivein interfaceRevivable- Specified by:
revivein classDefinitionImpl
-
equals
- Overrides:
equalsin classDefinitionImpl
-
hashCode
public int hashCode()- Overrides:
hashCodein classDefinitionImpl
-
toString
- Overrides:
toStringin classDefinitionImpl
-
debugDumpShortToString
Used in debugDumping items. Does not need to have name in it as item already has it. Does not need to have class as that is just too much info that is almost anytime pretty obvious anyway.- Specified by:
debugDumpShortToStringin interfaceItemDefinition<I extends Item<?,?>>
-
debugMultiplicity
-
debugFlags
-
extendToString
-
isInherited
public boolean isInherited()Description copied from interface:ItemDefinitionWhether the item is inherited from a supertype.- Specified by:
isInheritedin interfaceItemDefinition<I extends Item<?,?>>
-
setInherited
public void setInherited(boolean inherited) - Specified by:
setInheritedin interfaceMutableItemDefinition<I extends Item<?,?>>
-
isIndexOnly
public boolean isIndexOnly()Description copied from interface:ItemDefinitionIf true, this item is not stored in XML representation in repo. TODO better name- Specified by:
isIndexOnlyin interfaceItemDefinition<I extends Item<?,?>>
-
setIndexOnly
public void setIndexOnly(boolean indexOnly) - Specified by:
setIndexOnlyin interfaceMutableItemDefinition<I extends Item<?,?>>
-
isSearchable
public boolean isSearchable()Description copied from interface:ItemDefinitionReturns true if item definition is searchable.- Specified by:
isSearchablein interfaceItemDefinition<I extends Item<?,?>> - Returns:
-
setSearchable
public void setSearchable(boolean searchable) - Specified by:
setSearchablein interfaceMutableItemDefinition<I extends Item<?,?>>
-
replaceName
- Specified by:
replaceNamein interfaceItemDefinitionTestAccess
-
writeReplace
-