org.objectweb.jonathan.libs.kernel
Class JElement

java.lang.Object
  extended byorg.objectweb.jonathan.libs.kernel.JElement
All Implemented Interfaces:
Element
Direct Known Subclasses:
JContextFactory.ContextElement, JTreeElement

public class JElement
extends java.lang.Object
implements Element

Basic implementation of a runtime element. Its behaviour is a property component's. Must be subtyped to behave differently.


Constructor Summary
JElement(Component _container, java.lang.String _name, Component _target)
           
 
Method Summary
 Component getComponent()
          Returns the component contained in the target element.
 Component getContainer()
          Returns the context containing the target element, if any, null otherwise.
 int getIntValue()
          Returns the value of the target element, if its class is an integer class.
 java.lang.String getName()
          Returns the (local) name of the element, in the context it belongs to.
 java.lang.Class getType()
          Returns the type of the target element, as a Class.
 java.lang.Object getValue()
          Returns the value of the target element, if its type is an object reference type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JElement

public JElement(Component _container,
                java.lang.String _name,
                Component _target)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Element
Returns the (local) name of the element, in the context it belongs to.

Specified by:
getName in interface Element
Returns:
the (local) name of the element, in the context it belongs to.

getComponent

public Component getComponent()
Description copied from interface: Element
Returns the component contained in the target element.

Specified by:
getComponent in interface Element
Returns:
the component contained in the target element.

getType

public java.lang.Class getType()
Description copied from interface: Element
Returns the type of the target element, as a Class.

Specified by:
getType in interface Element
Returns:
the type of the target element, as a Class.

getValue

public java.lang.Object getValue()
Description copied from interface: Element
Returns the value of the target element, if its type is an object reference type.

If the target element is of an integral type, NO_VALUE} is returned.

Specified by:
getValue in interface Element
Returns:
the value of the target element.

getIntValue

public int getIntValue()
Description copied from interface: Element
Returns the value of the target element, if its class is an integer class.

If the target element has an object reference type, Integer.MAX_VALUE is returned.

Specified by:
getIntValue in interface Element
Returns:
the value of the target element.

getContainer

public Component getContainer()
Description copied from interface: Element
Returns the context containing the target element, if any, null otherwise.

Specified by:
getContainer in interface Element
Returns:
the context containing the target element, if any, null otherwise.

toString

public java.lang.String toString()