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:
ResourceAttributeDefinitionImpl
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
Definitionfor 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, PrismContext prismContext)PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, Collection<? extends DisplayableValue<T>> allowedValues, T defaultValue)PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, Collection<? extends DisplayableValue<T>> allowedValues, T defaultValue, QName definedInType)PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, QName definedInType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeDefinitionOf(PrismValue pvalue)@NotNull PrismPropertyDefinitionImpl<T>clone()protected voidcopyDefinitionData(PrismPropertyDefinitionImpl<T> clone)PropertyDelta<T>createEmptyDelta(ItemPath path)TdefaultValue()booleanequals(Object o)protected voidextendToString(StringBuilder sb)Collection<? extends DisplayableValue<T>>getAllowedValues()Returns allowed values for this property.protected StringgetDebugDumpClassName()Return a human readable name of this class suitable for logs.StringgetDocClassName()Returns human-readable name of this class suitable for documentation.QNamegetMatchingRuleQName()Returns matching rule name.QNamegetValueType()Returns QName of the property value type.inthashCode()@NotNull PrismProperty<T>instantiate()Create an item instance.@NotNull PrismProperty<T>instantiate(QName name)Create an item instance.BooleanisIndexed()This is XSD annotation that specifies whether a property should be indexed in the storage.voidsetIndexed(Boolean indexed)voidsetMatchingRuleQName(QName matchingRuleQName)Optional<ComplexTypeDefinition>structuredType()Returns complex type definition of item, if underlying value is possible structured.MutablePrismPropertyDefinition<T>toMutable()-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, copyDefinitionData, debugDumpShortToString, debugFlags, debugMultiplicity, deepClone, deepClone, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isOperational, isOptional, isValidFor, 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, copyDefinitionData, debugDump, extendDumpHeader, getAnnotation, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getTypeClass, getTypeClassIfKnown, 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, getDeprecatedSince, getDiagrams, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getMutabilityFlag, getPlannedRemoval, getProcessing, getSchemaMigrations, getSchemaRegistry, getTypeClassIfKnown, 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, deepClone, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor, revive
-
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
-
-
-
-
Constructor Detail
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext)
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, QName definedInType)
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, Collection<? extends DisplayableValue<T>> allowedValues, T defaultValue)
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, Collection<? extends DisplayableValue<T>> allowedValues, T defaultValue, QName definedInType)
-
-
Method Detail
-
getAllowedValues
public Collection<? extends DisplayableValue<T>> getAllowedValues()
Returns allowed values for this property.- Specified by:
getAllowedValuesin interfacePrismPropertyDefinition<T>- Returns:
- Object array. May be null.
-
defaultValue
public T defaultValue()
- Specified by:
defaultValuein interfacePrismPropertyDefinition<T>
-
getValueType
public QName getValueType()
Description copied from interface:PrismPropertyDefinitionReturns QName of the property value type.The returned type is either XSD simple type or complex type. It may not be defined in the same schema (especially if it is standard XSD simple type).
- Specified by:
getValueTypein interfacePrismPropertyDefinition<T>- Returns:
- QName of the property value type NOTE: This is very strange property. Isn't it the same as typeName(). It is even not used in midPoint. Marking as deprecated.
-
isIndexed
public Boolean isIndexed()
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:
isIndexedin interfacePrismPropertyDefinition<T>
-
setIndexed
public void setIndexed(Boolean indexed)
- Specified by:
setIndexedin interfaceMutablePrismPropertyDefinition<T>
-
getMatchingRuleQName
public QName getMatchingRuleQName()
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:
getMatchingRuleQNamein interfacePrismPropertyDefinition<T>- Returns:
- matching rule name
-
setMatchingRuleQName
public void setMatchingRuleQName(QName matchingRuleQName)
- Specified by:
setMatchingRuleQNamein interfaceMutablePrismPropertyDefinition<T>
-
instantiate
@NotNull public @NotNull PrismProperty<T> instantiate()
Description copied from interface:ItemDefinitionCreate an item instance. Definition name or default name will used as an element name for the instance. The instance will otherwise be empty.- Specified by:
instantiatein interfaceItemDefinition<T>- Specified by:
instantiatein interfacePrismPropertyDefinition<T>- Returns:
- created item instance
-
instantiate
@NotNull public @NotNull PrismProperty<T> 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<T>- Specified by:
instantiatein interfacePrismPropertyDefinition<T>- Returns:
- created item instance
-
createEmptyDelta
public PropertyDelta<T> createEmptyDelta(ItemPath path)
- Specified by:
createEmptyDeltain interfaceItemDefinition<T>- Specified by:
createEmptyDeltain interfacePrismPropertyDefinition<T>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
- Specified by:
canBeDefinitionOfin interfaceItemDefinition<T>
-
clone
@NotNull public @NotNull PrismPropertyDefinitionImpl<T> clone()
- Specified by:
clonein interfaceDefinition- Specified by:
clonein interfaceItemDefinition<T>- Specified by:
clonein interfaceMutablePrismPropertyDefinition<T>- Specified by:
clonein interfacePrismPropertyDefinition<T>- Specified by:
clonein classItemDefinitionImpl<PrismProperty<T>>
-
copyDefinitionData
protected void copyDefinitionData(PrismPropertyDefinitionImpl<T> clone)
-
extendToString
protected void extendToString(StringBuilder sb)
- Overrides:
extendToStringin classItemDefinitionImpl<PrismProperty<T>>
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classItemDefinitionImpl<PrismProperty<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classItemDefinitionImpl<PrismProperty<T>>
-
getDebugDumpClassName
protected 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
-
toMutable
public MutablePrismPropertyDefinition<T> toMutable()
- Specified by:
toMutablein interfaceDefinition- Specified by:
toMutablein interfaceItemDefinition<T>- Specified by:
toMutablein interfacePrismPropertyDefinition<T>
-
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<T>- Returns:
-
-