Class PrismPropertyDefinitionImpl<T>
- java.lang.Object
-
- 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
,ItemDefinition<PrismProperty<T>>
,MutableDefinition
,MutableItemDefinition<PrismProperty<T>>
,MutablePrismPropertyDefinition<T>
,PrismPropertyDefinition<T>
,Revivable
,Visitable
,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
Definition
for more details.- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
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, prismContext, 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeDefinitionOf(PrismValue pvalue)
PrismPropertyDefinitionImpl<T>
clone()
protected void
copyDefinitionData(PrismPropertyDefinitionImpl<T> clone)
PropertyDelta<T>
createEmptyDelta(ItemPath path)
T
defaultValue()
boolean
equals(Object o)
protected void
extendToString(StringBuilder sb)
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.QName
getValueType()
Returns QName of the property value type.int
hashCode()
PrismProperty<T>
instantiate()
Create an item instance.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
setIndexed(Boolean indexed)
void
setMatchingRuleQName(QName matchingRuleQName)
MutablePrismPropertyDefinition<T>
toMutable()
-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
accept, adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, copyDefinitionData, debugDumpShortToString, debugFlags, debugMultiplicity, deepClone, deepClone, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor, revive, setCanAdd, setCanModify, setCanRead, setDynamic, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setReadOnly, setSubstitutionHead, setValueEnumerationRef, toString
-
Methods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
addSchemaMigration, copyDefinitionData, debugDump, extendDumpHeader, getAnnotation, getDeprecatedSince, 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 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, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getSchemaRegistry, getTypeClassIfKnown, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAnnotation
-
Methods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, 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
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.PrismPropertyDefinition
getTypeClass, isAnyType
-
-
-
-
Constructor Detail
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext)
-
PrismPropertyDefinitionImpl
public PrismPropertyDefinitionImpl(QName elementName, QName typeName, PrismContext prismContext, Collection<? extends DisplayableValue<T>> allowedValues, T defaultValue)
-
-
Method Detail
-
getAllowedValues
public Collection<? extends DisplayableValue<T>> getAllowedValues()
Returns allowed values for this property.- Specified by:
getAllowedValues
in interfacePrismPropertyDefinition<T>
- Returns:
- Object array. May be null.
-
defaultValue
public T defaultValue()
- Specified by:
defaultValue
in interfacePrismPropertyDefinition<T>
-
getValueType
public QName getValueType()
Description copied from interface:PrismPropertyDefinition
Returns 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:
getValueType
in 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:
isIndexed
in interfacePrismPropertyDefinition<T>
-
setIndexed
public void setIndexed(Boolean indexed)
- Specified by:
setIndexed
in 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:
getMatchingRuleQName
in interfacePrismPropertyDefinition<T>
- Returns:
- matching rule name
-
setMatchingRuleQName
public void setMatchingRuleQName(QName matchingRuleQName)
- Specified by:
setMatchingRuleQName
in interfaceMutablePrismPropertyDefinition<T>
-
instantiate
@NotNull public PrismProperty<T> instantiate()
Description copied from interface:ItemDefinition
Create 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:
instantiate
in interfaceItemDefinition<T>
- Specified by:
instantiate
in interfacePrismPropertyDefinition<T>
- Returns:
- created item instance
-
instantiate
@NotNull public 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>
- Returns:
- created item instance
-
createEmptyDelta
public PropertyDelta<T> createEmptyDelta(ItemPath path)
- Specified by:
createEmptyDelta
in interfaceItemDefinition<T>
- Specified by:
createEmptyDelta
in interfacePrismPropertyDefinition<T>
-
canBeDefinitionOf
public boolean canBeDefinitionOf(PrismValue pvalue)
- Specified by:
canBeDefinitionOf
in interfaceItemDefinition<T>
-
clone
@NotNull public 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>>
-
copyDefinitionData
protected void copyDefinitionData(PrismPropertyDefinitionImpl<T> clone)
-
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()
- Specified by:
toMutable
in interfaceDefinition
- Specified by:
toMutable
in interfaceItemDefinition<T>
- Specified by:
toMutable
in interfacePrismPropertyDefinition<T>
-
-