Buju 0.4

biz.bbeans.util
Class BClassInspector

java.lang.Object
  extended bybiz.bbeans.util.BClassInspector

public class BClassInspector
extends Object

Utility to inspect a class using Java reflection.


Constructor Summary
BClassInspector(Class cls)
          Create a new BClassInspector to inspect the given class.
BClassInspector(Object obj)
          Create a new BClassInspector to inspect the class of the given object.
 
Method Summary
static ArrayList getSuperclasses(Class cls, ArrayList supers)
          Get all of the super classes.
static void main(String[] args)
          Usage: biz.bbeans.util.BClassInspector className
 void printConstructors()
          Print all constructors of the inspected class.
 void printDeclaredConstructors()
          Print all declared constructors of the inspected class.
 void printDeclaredFields()
          Print all declared fields of the inspected class.
 void printDeclaredMethods()
          Print all declared methods of the inspected class.
 void printInterfaces()
          Print all interfaces of the inspected class.
 void printSuperclasses()
          Print all of the super classes.
 void setInputStream(InputStream in)
          Set the InputStream.
 void setPrintStream(PrintStream out)
          Set the PrintStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BClassInspector

public BClassInspector(Class cls)
Create a new BClassInspector to inspect the given class.

Parameters:
cls - Class to inspect.

BClassInspector

public BClassInspector(Object obj)
Create a new BClassInspector to inspect the class of the given object.

Parameters:
obj - Object whose class is to be inspected.
Method Detail

setInputStream

public void setInputStream(InputStream in)
Set the InputStream. The default is System.in.

Parameters:
in - InputStream to use to communicate with this object.

setPrintStream

public void setPrintStream(PrintStream out)
Set the PrintStream. The default is System.out.

Parameters:
out - PrintStream to use for output.

printSuperclasses

public void printSuperclasses()
                       throws IOException
Print all of the super classes.

Throws:
IOException

getSuperclasses

public static ArrayList getSuperclasses(Class cls,
                                        ArrayList supers)
Get all of the super classes.

Parameters:
cls - Class to inspect.
supers - List of super Class objects.
Returns:
List of super Class objects.

printInterfaces

public void printInterfaces()
                     throws IOException
Print all interfaces of the inspected class.

Throws:
IOException - If I/O exception occurs.

printConstructors

public void printConstructors()
                       throws IOException
Print all constructors of the inspected class.

Throws:
IOException - If I/O exception occurs.

printDeclaredConstructors

public void printDeclaredConstructors()
                               throws IOException
Print all declared constructors of the inspected class.

Throws:
IOException - If I/O exception occurs.

printDeclaredMethods

public void printDeclaredMethods()
                          throws IOException
Print all declared methods of the inspected class.

Throws:
IOException - If I/O exception occurs.

printDeclaredFields

public void printDeclaredFields()
                         throws IOException
Print all declared fields of the inspected class.

Throws:
IOException - If I/O exception occurs.

main

public static void main(String[] args)
Usage: biz.bbeans.util.BClassInspector className


Buju 0.4