texsoft.java.object
Class XsInspectionFactory

java.lang.Object
  extended bytexsoft.java.object.XsInspectionFactory

public abstract class XsInspectionFactory
extends java.lang.Object

This class act as a factory/repository for XsClassInspectors.

The static methods of this class allow to retrieve/create and delete XsClassInspector object for given classes/interfaces.

This allow to save space and time: for the whole VM only one instance of inspector is created for each requested class/interface, and only once.


Constructor Summary
XsInspectionFactory()
           
 
Method Summary
static void dump(java.io.PrintStream out)
          Lists all classes and inspectors present in the factory to the passed stream.
static XsClassInspector getInspector(java.lang.Class cl)
          Given a class/interface returns a XsClassInspector for that class.
static void removeInspector(java.lang.Class cl)
          Remove from the factory the XsClassInspector for the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XsInspectionFactory

public XsInspectionFactory()
Method Detail

getInspector

public static XsClassInspector getInspector(java.lang.Class cl)
                                     throws XsObjectException
Given a class/interface returns a XsClassInspector for that class.

If no XsClassInspector for that class is already in the factory, a new one is just created.

Parameters:
cl - class to search for into the XsClassInspectors' repository.
Returns:
the inspector for the fiven class.
Throws:
XsObjectException - thrown if can't acquire reflection information for the given class

removeInspector

public static void removeInspector(java.lang.Class cl)
Remove from the factory the XsClassInspector for the given class.

Parameters:
cl - class to search for into the XsClassInspectors' repository.

dump

public static void dump(java.io.PrintStream out)
Lists all classes and inspectors present in the factory to the passed stream.

Parameters:
out - stream to which the output is sent.