Class cam.codegen.ClassInterrogator
java.lang.Object
|
+----cam.codegen.ClassInterrogator
- public class ClassInterrogator
- extends Object
This class provides a programming interface to the Java class
reflection methods. The class to be interrogated is specifed
with the setClass(...) method.
- Version:
- 9/18/98
- Author:
- Chris Anderson (C) UCLA 1998
-
ClassInterrogator()
-
-
getArgumentNames(int)
- Returns default argument names for the method parameters.
-
getClassName()
- Returns the class name (without the package preface)
-
getExceptionNames(int)
- Returns the exceptions that are thrown by the public method.
-
getInterfaceStrings()
- Returns the interfaces that the class implements.
-
getMethodCount()
- Returns the number of public methods that the class
implements.
-
getMethodNames()
- Returns the public method names.
-
getPackageName()
- Returns the package name.
-
getParameterNames(int)
- Returns the parameters of the method.
-
getReturnNames()
- Returns the names of the objects that are
returned by the public methods.
-
getSuperclassName()
- Returns the super class (parent class) name.
-
main(String[])
-
-
setClass(String)
- Sets the class to be interrogated.
ClassInterrogator
public ClassInterrogator()
setClass
public void setClass(String Cname) throws ClassNotFoundException
- Sets the class to be interrogated. The class name must be the full class name
(e.g. the name of the class including the package).
The class must reside in a directory that can be
located with the CLASSPATH/"package name" construct.
- Throws: ClassNotFoundException
- if class is not found.
getClassName
public String getClassName()
- Returns the class name (without the package preface)
getPackageName
public String getPackageName()
- Returns the package name.
getSuperclassName
public String getSuperclassName()
- Returns the super class (parent class) name.
getInterfaceStrings
public String[] getInterfaceStrings()
- Returns the interfaces that the class implements.
getMethodCount
public int getMethodCount()
- Returns the number of public methods that the class
implements. Static methods, and constructors are excluded.
getMethodNames
public String[] getMethodNames()
- Returns the public method names.
Static methods and constructors are excluded.
getReturnNames
public String[] getReturnNames()
- Returns the names of the objects that are
returned by the public methods.
getExceptionNames
public String[] getExceptionNames(int methodNumber)
- Returns the exceptions that are thrown by the public method.
- Parameters:
- methodNumber - The index of the method. The method index corresponds to the
index of the method in the array of method names obtained with
getMethodNames().
getParameterNames
public String[] getParameterNames(int methodNumber)
- Returns the parameters of the method.
- Parameters:
- methodNumber - The index of the method. The method index corresponds to the
index of the method in the array of method names obtained with
getMethodNames().
getArgumentNames
public String[] getArgumentNames(int methodNumber)
- Returns default argument names for the method parameters.
- Parameters:
- methodNumber - The index of the method. The method index corresponds to the
index of the method in the array of method names obtained with
getMethodNames().
main
public static void main(String args[])