com.evolveum.midpoint.schema.processor
Class Item

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

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

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

Field Summary
protected  Definition definition
           
protected  java.lang.Object element
           
protected  javax.xml.namespace.QName name
           
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
Item()
          Default constructor.
Item(javax.xml.namespace.QName name)
          The constructors should be used only occasionally (if used at all).
Item(javax.xml.namespace.QName name, Definition definition)
          The constructors should be used only occasionally (if used at all).
Item(javax.xml.namespace.QName name, Definition definition, java.lang.Object element)
          The constructors should be used only occasionally (if used at all).
 
Method Summary
 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.
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.
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.
 java.lang.String toString()
           
 
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

definition

protected Definition definition

element

protected java.lang.Object element
Constructor Detail

Item

public Item()
Default constructor. The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.


Item

public Item(javax.xml.namespace.QName name)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.

Parameters:
name - item name (element name)

Item

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

Parameters:
name - item name (element name)
definition - item definition (schema)

Item

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

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:
doc - DOM Document
Throws:
SchemaProcessorException - No definition or inconsistent definition
SchemaException

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 © 2011 evolveum. All Rights Reserved.