com.evolveum.midpoint.schema.processor
Class ItemDefinition

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

public abstract class ItemDefinition
extends Definition
implements java.io.Serializable

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:
Serialized Form

Field Summary
protected  javax.xml.namespace.QName name
           
 
Fields inherited from class com.evolveum.midpoint.schema.processor.Definition
defaultName, displayName, help, ignored, typeName
 
Method Summary
 javax.xml.namespace.QName getName()
          Returns name of the defined entity.
 javax.xml.namespace.QName getNameOrDefaultName()
          Returns either name (if specified) or default name.
abstract  Item instantiate()
          Create an item instance.
abstract  Item instantiate(javax.xml.namespace.QName name)
          Create an item instance.
abstract  Item instantiate(javax.xml.namespace.QName name, java.lang.Object element)
          Create an item instance.
abstract  Item parseItem(java.util.List<java.lang.Object> elements)
          Create at instance of the item initialized from the provided list of elements.
 java.lang.String toString()
           
 
Methods inherited from class com.evolveum.midpoint.schema.processor.Definition
dump, dump, getDefaultName, getDisplayName, getHelp, getTypeName, isIgnored, setDisplayName, setHelp, setIgnored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected javax.xml.namespace.QName name
Method Detail

getName

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

Returns:
the name name of the entity or null.

getNameOrDefaultName

public javax.xml.namespace.QName getNameOrDefaultName()
Returns either name (if specified) or default name. Convenience method.

Returns:
name or default name

instantiate

public abstract Item instantiate()
Create an item instance. Definition name or default name will used as an element name for the instance. The instance will otherwise be empty.

Returns:
created item instance

instantiate

public abstract Item instantiate(javax.xml.namespace.QName name)
Create an item instance. Definition name will use provided name. for the instance. The instance will otherwise be empty.

Returns:
created item instance

instantiate

public abstract Item instantiate(javax.xml.namespace.QName name,
                                 java.lang.Object element)
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.

Returns:
created item instance

parseItem

public abstract Item parseItem(java.util.List<java.lang.Object> elements)
                        throws SchemaException
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.

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 Definition


Copyright © 2011 evolveum. All Rights Reserved.