com.evolveum.midpoint.schema.processor
Class Item

java.lang.Object
  extended by com.evolveum.midpoint.schema.processor.Item
All Implemented Interfaces:
DebugDumpable, Dumpable, java.io.Serializable
Direct Known Subclasses:
Property, PropertyContainer

public abstract class Item
extends java.lang.Object
implements Dumpable, DebugDumpable, java.io.Serializable

Item is a common abstraction of Property and PropertyContainer.

This is supposed to be a superclass for all items. 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.

Author:
Radovan Semancik
See Also:
Serialized Form

Field Summary
protected  Definition definition
           
protected  java.lang.Object element
           
protected  javax.xml.namespace.QName name
           
protected  PropertyPath parentPath
           
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
Item(javax.xml.namespace.QName name, Definition definition, java.lang.Object element, PropertyPath parentPath)
          The constructors should be used only occasionally (if used at all).
 
Method Summary
abstract  Item clone()
           
protected  void copyValues(Item clone)
           
 java.lang.String debugDump()
          Provide terse and readable dump of the object suitable for log (at debug level).
 java.lang.String debugDump(int indent)
           
 java.lang.String dump()
          Show the content of the object intended for diagnostics by developer.
 boolean equals(java.lang.Object obj)
           
protected  java.lang.String getDebugDumpClassName()
          Return a human readable name of this class suitable for logs.
 Definition getDefinition()
          Returns applicable property definition.
 java.lang.String getDisplayName()
          Returns a display name for the property type.
 java.lang.Object getElement()
           
 java.lang.String getHelp()
          Returns help message defined for the property type.
 javax.xml.namespace.QName getName()
          Returns the name of the property.
 PropertyPath getParentPath()
           
 PropertyPath getPath()
           
 int hashCode()
           
abstract  void serializeToDom(org.w3c.dom.Node parentNode)
          Serializes property to DOM or JAXB element(s).
 void setDefinition(PropertyDefinition definition)
          Sets applicable property definition.
 void setElement(java.lang.Object element)
           
 void setName(javax.xml.namespace.QName name)
          Sets the name of the property.
 void setParentPath(PropertyPath parentPath)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected javax.xml.namespace.QName name

definition

protected Definition definition

element

protected java.lang.Object element

parentPath

protected PropertyPath parentPath
Constructor Detail

Item

public Item(javax.xml.namespace.QName name,
            Definition definition,
            java.lang.Object element,
            PropertyPath parentPath)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.

Method Detail

getDefinition

public Definition getDefinition()
Returns applicable property definition.

May return null if no definition is applicable or the definition is not know.

Returns:
applicable property definition

getName

public javax.xml.namespace.QName getName()
Returns the name of the property.

The name is a QName. It uniquely defines a property.

The name may be null, but such a property will not work.

The name is the QName of XML element in the XML representation.

Returns:
property name

setName

public void setName(javax.xml.namespace.QName name)
Sets the name of the property.

The name is a QName. It uniquely defines a property.

The name may be null, but such a property will not work.

The name is the QName of XML element in the XML representation.

Parameters:
name - the name to set

setDefinition

public void setDefinition(PropertyDefinition definition)
Sets applicable property definition.

Parameters:
definition - the definition to set

getElement

public java.lang.Object getElement()

setElement

public void setElement(java.lang.Object element)

getParentPath

public PropertyPath getParentPath()

setParentPath

public void setParentPath(PropertyPath parentPath)

getPath

public PropertyPath getPath()

getDisplayName

public java.lang.String getDisplayName()
Returns a display name for the property type.

Returns null if the display name cannot be determined.

The display name is fetched from the definition. If no definition (schema) is available, the display name will not be returned.

Returns:
display name for the property type

getHelp

public java.lang.String getHelp()
Returns help message defined for the property type.

Returns null if the help message cannot be determined.

The help message is fetched from the definition. If no definition (schema) is available, the help message will not be returned.

Returns:
help message for the property type

serializeToDom

public abstract void serializeToDom(org.w3c.dom.Node parentNode)
                             throws SchemaException
Serializes property to DOM or JAXB element(s).

The property name will be used as an element QName. The values will be in the element content. Single-value properties will produce one element (on none), multi-valued properies may produce several elements. All of the elements will have the same QName.

The property must have a definition (getDefinition() must not return null).

Parameters:
parentNode - DOM Document
Throws:
SchemaException - No definition or inconsistent definition

clone

public abstract Item clone()
Overrides:
clone in class java.lang.Object

copyValues

protected void copyValues(Item clone)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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

toString

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

dump

public java.lang.String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.

debugDump

public java.lang.String debugDump()
Provide terse and readable dump of the object suitable for log (at debug level).

Specified by:
debugDump in interface DebugDumpable
Returns:
content of the object intended for diagnostics by system administrator.

debugDump

public java.lang.String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable

getDebugDumpClassName

protected java.lang.String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.



Copyright © 2012 evolveum. All Rights Reserved.