com.evolveum.midpoint.schema.processor
Class PropertyDefinition

java.lang.Object
  extended by com.evolveum.midpoint.schema.processor.Definition
      extended by com.evolveum.midpoint.schema.processor.ItemDefinition
          extended by com.evolveum.midpoint.schema.processor.PropertyDefinition
All Implemented Interfaces:
DebugDumpable, Dumpable, java.io.Serializable
Direct Known Subclasses:
ObjectReferenceDefinition, ResourceObjectAttributeDefinition

public class PropertyDefinition
extends ItemDefinition

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.schema.processor.ItemDefinition
name
 
Fields inherited from class com.evolveum.midpoint.schema.processor.Definition
defaultName, displayName, help, ignored, typeName
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
PropertyDefinition(javax.xml.namespace.QName name, javax.xml.namespace.QName typeName)
           
PropertyDefinition(javax.xml.namespace.QName name, javax.xml.namespace.QName defaultName, javax.xml.namespace.QName typeName)
           
 
Method Summary
 boolean canCreate()
           
 boolean canRead()
          TODO:
 boolean canUpdate()
          TODO:
 boolean equals(java.lang.Object obj)
           
 java.lang.Object[] getAllowedValues()
          Returns allowed values for this property.
 int getMaxOccurs()
          Return the number of maximal value occurrences.
 int getMinOccurs()
          Return the number of minimal value occurrences.
 javax.xml.namespace.QName getValueType()
          Returns QName of the property value type.
 int hashCode()
           
 Property instantiate(PropertyPath parentPath)
          Create an item instance.
 Property instantiate(javax.xml.namespace.QName name, java.lang.Object element, PropertyPath parentPath)
          Create an item instance.
 Property instantiate(javax.xml.namespace.QName name, PropertyPath parentPath)
          Create an item instance.
 boolean isMandatory()
          Returns true if property is mandatory.
 boolean isMultiValue()
          Returns true if property is multi-valued.
 boolean isOptional()
          Returns true if property is optional.
 boolean isSingleValue()
          Returns true if property is single-valued.
 Property parseFromValueElement(org.w3c.dom.Element valueElement, PropertyPath parentPath)
           
 Property parseItem(java.util.List<java.lang.Object> elements, PropertyPath parentPath)
          Create at instance of the item initialized from the provided list of elements.
 Property parseItemFromJaxbObject(java.lang.Object jaxbObject, PropertyPath parentPath)
           
 void setCreate(boolean create)
           
 void setMaxOccurs(int maxOccurs)
           
 void setMinOccurs(int minOccurs)
           
 void setRead(boolean read)
           
 void setReadOnly()
           
 void setUpdate(boolean update)
           
 java.lang.String toString()
           
 
Methods inherited from class com.evolveum.midpoint.schema.processor.ItemDefinition
copyDefinitionData, getName, getNameOrDefaultName, setName
 
Methods inherited from class com.evolveum.midpoint.schema.processor.Definition
copyDefinitionData, debugDump, debugDump, dump, getDefaultName, getDisplayName, getHelp, getTypeName, isIgnored, setDisplayName, setHelp, setIgnored
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyDefinition

public PropertyDefinition(javax.xml.namespace.QName name,
                          javax.xml.namespace.QName defaultName,
                          javax.xml.namespace.QName typeName)

PropertyDefinition

public PropertyDefinition(javax.xml.namespace.QName name,
                          javax.xml.namespace.QName typeName)
Method Detail

getAllowedValues

public java.lang.Object[] getAllowedValues()
Returns allowed values for this property.

Returns:
Object array. May be null.

canRead

public boolean canRead()
TODO:

Returns:

canUpdate

public boolean canUpdate()
TODO:

Returns:

setReadOnly

public void setReadOnly()

getValueType

public javax.xml.namespace.QName getValueType()
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).

Returns:
QName of the property value type

getMinOccurs

public int getMinOccurs()
Return the number of minimal value occurrences.

Returns:
the minOccurs

setMinOccurs

public void setMinOccurs(int minOccurs)

getMaxOccurs

public int getMaxOccurs()
Return the number of maximal value occurrences.

Any negative number means "unbounded".

Returns:
the maxOccurs

setMaxOccurs

public void setMaxOccurs(int maxOccurs)

isSingleValue

public boolean isSingleValue()
Returns true if property is single-valued.

Returns:
true if property is single-valued.

isMultiValue

public boolean isMultiValue()
Returns true if property is multi-valued.

Returns:
true if property is multi-valued.

isMandatory

public boolean isMandatory()
Returns true if property is mandatory.

Returns:
true if property is mandatory.

isOptional

public boolean isOptional()
Returns true if property is optional.

Returns:
true if property is optional.

instantiate

public Property instantiate(PropertyPath parentPath)
Description copied from class: 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 class ItemDefinition
Returns:
created item instance

instantiate

public Property instantiate(javax.xml.namespace.QName name,
                            PropertyPath parentPath)
Description copied from class: ItemDefinition
Create an item instance. Definition name will use provided name. for the instance. The instance will otherwise be empty.

Specified by:
instantiate in class ItemDefinition
Returns:
created item instance

instantiate

public Property instantiate(javax.xml.namespace.QName name,
                            java.lang.Object element,
                            PropertyPath parentPath)
Description copied from class: ItemDefinition
Create an item instance. Definition name will use provided name. for the instance. The instance will contain reference to the element from which it originated.

Specified by:
instantiate in class ItemDefinition
Returns:
created item instance

setRead

public void setRead(boolean read)

setUpdate

public void setUpdate(boolean update)

setCreate

public void setCreate(boolean create)

canCreate

public boolean canCreate()

parseItem

public Property parseItem(java.util.List<java.lang.Object> elements,
                          PropertyPath parentPath)
                   throws SchemaException
Description copied from class: ItemDefinition
Create at instance of the item initialized from the provided list of elements. The definition name (ore default name) will be used as the instance (element) name.

Specified by:
parseItem in class ItemDefinition
Parameters:
elements - content of the item
Returns:
created item instance initialized with content
Throws:
SchemaException - error parsing the provided elements

toString

public java.lang.String toString()
Overrides:
toString in class ItemDefinition

parseFromValueElement

public Property parseFromValueElement(org.w3c.dom.Element valueElement,
                                      PropertyPath parentPath)
                               throws SchemaException
Throws:
SchemaException

parseItemFromJaxbObject

public Property parseItemFromJaxbObject(java.lang.Object jaxbObject,
                                        PropertyPath parentPath)
                                 throws SchemaException
Specified by:
parseItemFromJaxbObject in class ItemDefinition
Throws:
SchemaException

hashCode

public int hashCode()
Overrides:
hashCode in class ItemDefinition

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class ItemDefinition


Copyright © 2012 evolveum. All Rights Reserved.