Class PrismPropertyDefinitionImpl<T>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.DefinitionImpl
-
- com.evolveum.midpoint.prism.impl.ItemDefinitionImpl<PrismProperty<T>>
-
- com.evolveum.midpoint.prism.impl.PrismPropertyDefinitionImpl<T>
-
- All Implemented Interfaces:
Definition
,Freezable
,ItemDefinition<PrismProperty<T>>
,ItemDefinitionTestAccess
,MutableDefinition
,MutableItemDefinition<PrismProperty<T>>
,MutablePrismPropertyDefinition<T>
,PrismContextSensitive
,PrismItemAccessDefinition
,PrismPropertyDefinition<T>
,Revivable
,SmartVisitable<Definition>
,Visitable<Definition>
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
RawResourceAttributeDefinitionImpl
public class PrismPropertyDefinitionImpl<T> extends ItemDefinitionImpl<PrismProperty<T>> implements PrismPropertyDefinition<T>, MutablePrismPropertyDefinition<T>
Property Definition.Property is a basic unit of information in midPoint. This class provides definition of property type, multiplicity and so on.
Property is a specific characteristic of an object. It may be considered object "attribute" or "field". For example User has fullName property that contains string value of user's full name.
Properties may be single-valued or multi-valued
Properties may contain primitive types or complex types (defined by XSD schema)
Property values are unordered, implementation may change the order of values
Duplicate values of properties should be silently removed by implementations, but clients must be able tolerate presence of duplicate values.
Operations that modify the objects work with the granularity of properties. They add/remove/replace the values of properties, but do not "see" inside the property.
This class represents schema definition for property. See
Definition
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 PrismPropertyDefinitionImpl(QName elementName, QName typeName)
PrismPropertyDefinitionImpl(QName elementName, QName typeName, QName definedInType)
PrismPropertyDefinitionImpl(QName elementName, QName typeName, T defaultValue)
PrismPropertyDefinitionImpl(QName elementName, QName typeName, T defaultValue, QName definedInType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeDefinitionOf(PrismValue pvalue)
TODO document@NotNull PrismPropertyDefinitionImpl<T>
clone()
protected void
copyDefinitionDataFrom(PrismPropertyDefinition<T> source)
@NotNull PropertyDelta<T>
createEmptyDelta(ItemPath path)
Creates an empty delta (with appropriate implementation class), pointing to this item definition, with a given path.T
defaultValue()
boolean
equals(Object o)
protected void
extendToString(StringBuilder sb)
@Nullable Collection<? extends DisplayableValue<T>>
getAllowedValues()
Returns allowed values for this property.protected 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
getMatchingRuleQName()
Returns matching rule name.@Nullable Collection<? extends DisplayableValue<T>>
getSuggestedValues()
Returns suggested values for this property.int
hashCode()
@NotNull PrismProperty<T>
instantiate()
Create an item instance.@NotNull PrismProperty<T>
instantiate(QName name)
Create an item instance.Boolean
isIndexed()
This is XSD annotation that specifies whether a property should be indexed in the storage.void
setAllowedValues(Collection<? extends DisplayableValue<T>> allowedValues)
void
setIndexed(Boolean indexed)
void
setMatchingRuleQName(QName matchingRuleQName)
void
setSuggestedValues(Collection<? extends DisplayableValue<T>> suggestedValues)
Optional<ComplexTypeDefinition>
structuredType()
Returns complex type definition of item, if underlying value is possible structured.MutablePrismPropertyDefinition<T>
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, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isOperational, isValidFor, 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, getTypeClass, 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, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor
-
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, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setReadOnly, setSubstitutionHead, setValueEnumerationRef
-
Methods inherited from interface com.evolveum.midpoint.prism.MutablePrismPropertyDefinition
setInherited
-
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.PrismPropertyDefinition
getTypeClass, isAnyType
-
Methods inherited from interface com.evolveum.midpoint.prism.SmartVisitable
accept
-
-
-
-
Method Detail
-
getAllowedValues
@Nullable public @Nullable Collection<? extends DisplayableValue<T>> getAllowedValues()
Description copied from interface:PrismPropertyDefinition
Returns allowed values for this property.- Specified by:
getAllowedValues
in interfacePrismPropertyDefinition<T>
-
setAllowedValues
public void setAllowedValues(Collection<? extends DisplayableValue<T>> allowedValues)
- Specified by:
setAllowedValues
in interfaceMutablePrismPropertyDefinition<T>
-
getSuggestedValues
@Nullable public @Nullable Collection<? extends DisplayableValue<T>> getSuggestedValues()
Description copied from interface:PrismPropertyDefinition
Returns suggested values for this property.- Specified by:
getSuggestedValues
in interfacePrismPropertyDefinition<T>
-
setSuggestedValues
public void setSuggestedValues(Collection<? extends DisplayableValue<T>> suggestedValues)
- Specified by:
setSuggestedValues
in interfaceMutablePrismPropertyDefinition<T>
-
defaultValue
public T defaultValue()
- Specified by:
defaultValue
in interfacePrismPropertyDefinition<T>
-
isIndexed
public Boolean isIndexed()
Description copied from interface:PrismPropertyDefinition
This is XSD annotation that specifies whether a property should be indexed in the storage. It can only apply to properties. It has following meaning: true: the property must be indexed. If the storage is not able to index the value, it should indicate an error. false: the property should not be indexed. null: data store decides whether to index the property or not.- Specified by:
isIndexed
in interfacePrismPropertyDefinition<T>
-
setIndexed
public void setIndexed(Boolean indexed)
- Specified by:
setIndexed
in interfaceMutablePrismPropertyDefinition<T>
-
getMatchingRuleQName
public QName getMatchingRuleQName()
Description copied from interface:PrismPropertyDefinition
Returns matching rule name. Matching rules are algorithms that specify how to compare, normalize and/or order the values. E.g. there are matching rules for case insensitive string comparison, for LDAP DNs, etc.- Specified by:
getMatchingRuleQName
in interfacePrismPropertyDefinition<T>
- Returns:
- matching rule name
-
setMatchingRuleQName
public void setMatchingRuleQName(QName matchingRuleQName)
- Specified by:
setMatchingRuleQName
in interfaceMutablePrismPropertyDefinition<T>
-
instantiate
@NotNull public @NotNull PrismProperty<T> 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<T>
- Specified by:
instantiate
in interfacePrismPropertyDefinition<T>
-
instantiate
@NotNull public @NotNull PrismProperty<T> 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<T>
- Specified by:
instantiate
in interfacePrismPropertyDefinition<T>
-
createEmptyDelta
@NotNull public @NotNull PropertyDelta<T> 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<T>
- Specified by:
createEmptyDelta
in interfacePrismPropertyDefinition<T>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
Description copied from interface:ItemDefinition
TODO document- Specified by:
canBeDefinitionOf
in interfaceItemDefinition<T>
-
clone
@NotNull public @NotNull PrismPropertyDefinitionImpl<T> clone()
- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<T>
- Specified by:
clone
in interfaceMutablePrismPropertyDefinition<T>
- Specified by:
clone
in interfacePrismPropertyDefinition<T>
- Specified by:
clone
in classItemDefinitionImpl<PrismProperty<T>>
-
copyDefinitionDataFrom
protected void copyDefinitionDataFrom(PrismPropertyDefinition<T> source)
-
extendToString
protected void extendToString(StringBuilder sb)
- Overrides:
extendToString
in classItemDefinitionImpl<PrismProperty<T>>
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classItemDefinitionImpl<PrismProperty<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classItemDefinitionImpl<PrismProperty<T>>
-
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
-
toMutable
public MutablePrismPropertyDefinition<T> toMutable()
Description copied from interface:Definition
Returns an interface to mutate this definition.- Specified by:
toMutable
in interfaceDefinition
- Specified by:
toMutable
in interfaceItemDefinition<T>
- Specified by:
toMutable
in interfacePrismPropertyDefinition<T>
-
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<T>
-
-