org.pf.joi
Class Inspector

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.pf.joi.Inspector
All Implemented Interfaces:
java.awt.event.MouseListener, java.util.EventListener
Direct Known Subclasses:
BasicInspector

public abstract class Inspector
extends java.awt.event.MouseAdapter

This is the default inspector, which can display all normal java objects. Currently it opens a window on the object to inspect and displays all of its fields that are not static and not final, which means no class variables and no constants, but all instance variables (including inherited attributes).
For arrays it lists up all elements from 0 to n.
For deeper inspection it is possible to open a new inspector on each attribute.

Here is an example how to use the inspector:

Since:
JDK 1.5
Version:
3.0
Author:
Manfred Duchrow

Field Summary
static java.lang.String EXPORTER_MAPPING_FILENAME
          The filename that will be looked up in each classpath element to load exporter classes ( implementors of ExportProvider ) automatically into the registry of JOI.
static java.lang.String EXPORTER_MAPPING_FILENAME_ALL
           
static java.lang.String EXPORTER_MAPPING_FILENAME_CLASSLOADER
           
static java.lang.String INSPECTOR_MAPPING_FILENAME
          The filename that will be looked up in each classpath element to load inspector classes ( subclasses of BasicInspector ) automatically into the registry of JOI.
static java.lang.String INSPECTOR_MAPPING_FILENAME_ALL
           
static java.lang.String INSPECTOR_MAPPING_FILENAME_CLASSLOADER
           
 
Method Summary
static Inspector basicInspect(java.lang.Object obj)
          Inspect the given object.
static Inspector basicInspect(java.lang.String name, java.lang.Object obj)
          Inspect the given object.
static void basicInspectWait(java.lang.Object obj)
          Inspect the given object like in basicInspect().
static void basicInspectWait(java.lang.String name, java.lang.Object obj)
          Inspect the given object like in basicInspect().
static void bindInspector(java.lang.String className, java.lang.String inspectorName)
          Bind a specific class or interface to a special inspector class.
static void deactivateHalt()
          Continues the current process.
static java.lang.String fullIdentification()
          Returns the component's long name and current version
static AbstractObjectSpy getBasicObjectSpy(java.lang.Object obj)
          Returns the object spy wrapper for the given object.
static AbstractObjectSpy getBasicObjectSpy(java.lang.String name, java.lang.Object obj)
          Returns the object spy wrapper for the given object.
static AbstractObjectSpy getObjectSpy(java.lang.Object obj)
          Returns the object spy wrapper for the given object.
static AbstractObjectSpy getObjectSpy(java.lang.String name, java.lang.Object obj)
          Returns the object spy wrapper for the given object.
static java.lang.String getProgSignature()
          Returns the name and current version of this component.
static void halt()
          Halts the current process.
static Inspector inspect(java.lang.Object obj)
          Inspect the given object.
static Inspector inspect(java.lang.String name, java.lang.Object obj)
          Inspect the given object.
static void inspectWait(java.lang.Object obj)
          Inspect the given object like in inspect().
static void inspectWait(java.lang.String name, java.lang.Object obj)
          Inspect the given object like in inspect().
static void main(java.lang.String[] args)
           
static java.lang.String shortIdentification()
          Returns the component's short name and current version
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSPECTOR_MAPPING_FILENAME

public static final java.lang.String INSPECTOR_MAPPING_FILENAME
The filename that will be looked up in each classpath element to load inspector classes ( subclasses of BasicInspector ) automatically into the registry of JOI.
Filename: "META-INF/joi.inspector"

See Also:
Constant Field Values

INSPECTOR_MAPPING_FILENAME_CLASSLOADER

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

INSPECTOR_MAPPING_FILENAME_ALL

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

EXPORTER_MAPPING_FILENAME

public static final java.lang.String EXPORTER_MAPPING_FILENAME
The filename that will be looked up in each classpath element to load exporter classes ( implementors of ExportProvider ) automatically into the registry of JOI.
Filename: "META-INF/joi.exporter"

See Also:
Constant Field Values

EXPORTER_MAPPING_FILENAME_CLASSLOADER

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

EXPORTER_MAPPING_FILENAME_ALL

public static final java.lang.String EXPORTER_MAPPING_FILENAME_ALL
See Also:
Constant Field Values
Method Detail

basicInspect

public static Inspector basicInspect(java.lang.Object obj)
Inspect the given object.
That means to display the internal state of the given object's attributes. This method is always using the basic inspector.

Parameters:
obj - The object to look inside

basicInspect

public static Inspector basicInspect(java.lang.String name,
                                     java.lang.Object obj)
Inspect the given object.
That means to display the internal state of the given object's attributes. This method is always using the basic inspector.

Parameters:
name - The name of the object in its program context
obj - The object to look inside

inspect

public static Inspector inspect(java.lang.Object obj)
Inspect the given object.
That means to display the internal state of the given object's attributes. The inspector can be a specialized one for the class of the given object.

Parameters:
obj - The object to look inside

inspect

public static Inspector inspect(java.lang.String name,
                                java.lang.Object obj)
Inspect the given object.
That means to display the internal state of the given object's attributes. The inspector can be a specialized one for the class of the given object.

Parameters:
obj - The object to look inside

basicInspectWait

public static void basicInspectWait(java.lang.Object obj)
Inspect the given object like in basicInspect().
But this method doesn't return until the inspector and all its sub-inspectors are closed again.

Parameters:
obj - The object to look inside

basicInspectWait

public static void basicInspectWait(java.lang.String name,
                                    java.lang.Object obj)
Inspect the given object like in basicInspect().
But this method doesn't return until the inspector and all its sub-inspectors are closed again.

Parameters:
name - The name of the object in its program context
obj - The object to look inside

inspectWait

public static void inspectWait(java.lang.Object obj)
Inspect the given object like in inspect().
But this method doesn't return until the inspector and all its sub-inspectors are closed again.

Parameters:
obj - The object to look inside

inspectWait

public static void inspectWait(java.lang.String name,
                               java.lang.Object obj)
Inspect the given object like in inspect().
But this method doesn't return until the inspector and all its sub-inspectors are closed again.

Parameters:
name - The name of the object in its program context
obj - The object to look inside

bindInspector

public static void bindInspector(java.lang.String className,
                                 java.lang.String inspectorName)
Bind a specific class or interface to a special inspector class.
This can be used to "install" self written specialized inspectors for specific classes or groups of classes.
If there is for example a special inspector for dates this method could look like the following:

Inspector.bindInspector( "java.util.Date", "com.xxx.debug.DateInspector" ) ;

or if there is a particular inspector for all objects that understand the BeanInfo interface:
Inspector.bindInspector( "java.beans.BeanInfo", "org.zzzz.inspect.BeanInfoInspector" ) ;

Parameters:
className - The fully qualified name of the class or interface
inspectorName - The fully qualified class name of the associated inspector

getBasicObjectSpy

public static AbstractObjectSpy getBasicObjectSpy(java.lang.Object obj)
Returns the object spy wrapper for the given object.
It will be wrapped by the basic inspector.

Parameters:
obj - The object to look inside

getBasicObjectSpy

public static AbstractObjectSpy getBasicObjectSpy(java.lang.String name,
                                                  java.lang.Object obj)
Returns the object spy wrapper for the given object.
It will be wrapped by the basic inspector.

Parameters:
name - The name of the object in its program context
obj - The object to look inside

getObjectSpy

public static AbstractObjectSpy getObjectSpy(java.lang.Object obj)
Returns the object spy wrapper for the given object.
It will be wrapped by the inspector that is registerd for the object's type.

Parameters:
obj - The object to look inside

getObjectSpy

public static AbstractObjectSpy getObjectSpy(java.lang.String name,
                                             java.lang.Object obj)
Returns the object spy wrapper for the given object.
It will be wrapped by the inspector that is registerd for the object's type.

Parameters:
name - The name the object has in the program context
obj - The object to look inside

fullIdentification

public static java.lang.String fullIdentification()
Returns the component's long name and current version


shortIdentification

public static java.lang.String shortIdentification()
Returns the component's short name and current version


deactivateHalt

public static void deactivateHalt()
Continues the current process.


halt

public static void halt()
Halts the current process.


getProgSignature

public static java.lang.String getProgSignature()
Returns the name and current version of this component.


main

public static void main(java.lang.String[] args)