org.pf.joi
Class Spy

java.lang.Object
  extended by org.pf.joi.Spy
Direct Known Subclasses:
AbstractObjectSpy, ElementSpy

public abstract class Spy
extends java.lang.Object

This is the abstract superclass of all wrapper classes, that are holding inspected objects. It provides the API an inspector can use to display internal information of the inspected object.

Version:
1.3
Author:
Manfred Duchrow

Field Summary
static java.lang.String RENDERER_MAPPING_FILENAME
          The filename that will be looked up in each classpath element to load renderer classes automatically in the registry of JOI.
static java.lang.String RENDERER_MAPPING_FILENAME_ALL
           
static java.lang.String RENDERER_MAPPING_FILENAME_CLASSLOADER
           
 
Constructor Summary
Spy()
          Initialize the new instance with default values.
 
Method Summary
abstract  int getModifiers()
          Returns the declaration modifiers of the holded object.
abstract  java.lang.String getName()
          Returns the name of the inspected object
abstract  java.lang.Class getType()
          Returns the type of the holded object.
 java.lang.String getTypeString()
          Returns the string representation of the holded object's type (class).
abstract  java.lang.Object getValue()
          Returns the value of the holded object.
 java.awt.Component getValueComponent()
          Returns the visual component representation of the holded object's value or null if such a visual representation is not available.
 java.lang.String getValueString()
          Returns the string representation of the holded object's value.
 java.lang.String getValueTypeString()
          Returns the string representation of the holded object value's type (class).
 boolean is_boolean()
          Returns true if the type of the inspected object is boolean.
 boolean is_byte()
          Returns true if the type of the inspected object is byte.
 boolean is_char()
          Returns true if the type of the inspected object is char.
 boolean is_double()
          Returns true if the type of the inspected object is double.
 boolean is_float()
          Returns true if the type of the inspected object is float.
 boolean is_int()
          Returns true if the type of the inspected object is int.
 boolean is_long()
          Returns true if the type of the inspected object is long.
 boolean is_short()
          Returns true if the type of the inspected object is short.
 boolean isEditable()
          Returns true if the value of this spy can be modified.
 boolean isElementSpy()
          Returns true if this spy is an element spy.
 boolean isPrimitive()
          Returns true if the spyed object is a primitive type (e.g. int, boolean)
 void setValue(java.lang.Object newValue)
          Sets the given object as the new value of the spy's inspected object Here this method does nothing.
 boolean valueIsNull()
          Returns whether or not the value of the underlying object is null
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDERER_MAPPING_FILENAME

public static final java.lang.String RENDERER_MAPPING_FILENAME
The filename that will be looked up in each classpath element to load renderer classes automatically in the registry of JOI.
"META-INF/joi.renderer"

See Also:
Constant Field Values

RENDERER_MAPPING_FILENAME_CLASSLOADER

public static final java.lang.String RENDERER_MAPPING_FILENAME_CLASSLOADER
See Also:
Constant Field Values

RENDERER_MAPPING_FILENAME_ALL

public static final java.lang.String RENDERER_MAPPING_FILENAME_ALL
See Also:
Constant Field Values
Constructor Detail

Spy

public Spy()
Initialize the new instance with default values.

Method Detail

getName

public abstract java.lang.String getName()
Returns the name of the inspected object


getType

public abstract java.lang.Class getType()
Returns the type of the holded object.


getValue

public abstract java.lang.Object getValue()
                                   throws java.lang.Exception
Returns the value of the holded object.

Throws:
java.lang.Exception

getModifiers

public abstract int getModifiers()
Returns the declaration modifiers of the holded object.

See Also:
Modifier

getValueString

public java.lang.String getValueString()
                                throws java.lang.Exception
Returns the string representation of the holded object's value.

Throws:
java.lang.Exception

getValueComponent

public java.awt.Component getValueComponent()
                                     throws java.lang.Exception
Returns the visual component representation of the holded object's value or null if such a visual representation is not available.

Throws:
java.lang.Exception

getTypeString

public java.lang.String getTypeString()
Returns the string representation of the holded object's type (class).


getValueTypeString

public java.lang.String getValueTypeString()
                                    throws java.lang.Exception
Returns the string representation of the holded object value's type (class).

Throws:
java.lang.Exception

valueIsNull

public boolean valueIsNull()
                    throws java.lang.Exception
Returns whether or not the value of the underlying object is null

Throws:
java.lang.Exception

isElementSpy

public boolean isElementSpy()
Returns true if this spy is an element spy. Subclasses may override this to return true ;


isPrimitive

public boolean isPrimitive()
Returns true if the spyed object is a primitive type (e.g. int, boolean)


isEditable

public boolean isEditable()
Returns true if the value of this spy can be modified. This method always returns false. Subclasses my override this method to return true if appropriate.


setValue

public void setValue(java.lang.Object newValue)
              throws java.lang.Exception
Sets the given object as the new value of the spy's inspected object Here this method does nothing. Subclasses may override it to implement the actual modification. This method should only be overriden if isEditable() is also overriden to return true!

Throws:
java.lang.Exception

is_int

public boolean is_int()
Returns true if the type of the inspected object is int.


is_long

public boolean is_long()
Returns true if the type of the inspected object is long.


is_short

public boolean is_short()
Returns true if the type of the inspected object is short.


is_byte

public boolean is_byte()
Returns true if the type of the inspected object is byte.


is_char

public boolean is_char()
Returns true if the type of the inspected object is char.


is_boolean

public boolean is_boolean()
Returns true if the type of the inspected object is boolean.


is_double

public boolean is_double()
Returns true if the type of the inspected object is double.


is_float

public boolean is_float()
Returns true if the type of the inspected object is float.