|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.bytecode.IntrospectedCodeClass
public class IntrospectedCodeClass
CodeClass instances that represent normal Java Class objects.
Instances of IntrospectedCodeClass are generated using the static factory methods named forClass(). These methods ensure that the same IntrospectedCodeClass instance is returned for multiple invocations with the same argument.
Method Summary | |
---|---|
static CodeClass |
forClass(java.lang.Class c)
Get the CodeClass for a Java Class. |
static CodeClass |
forClass(java.lang.String name)
Get the CodeClass for a Java class name. |
static CodeMethod |
forMethod(java.lang.reflect.Method method)
|
CodeMethod |
getConstructor(CodeClass[] args)
Get a constructor by argument list. |
java.lang.String |
getDescriptor()
|
CodeField |
getFieldByName(java.lang.String name)
Get a field by its name. |
java.util.Set |
getFields()
Get all fields accessible through this class. |
java.util.List |
getInterfaces()
|
java.lang.String |
getJName()
|
CodeMethod |
getMethod(java.lang.String name,
CodeClass[] args)
Get a method by name and argument list. |
java.util.Set |
getMethods()
Get all methods declared by this class and its super classes, removing all super class methods that are over ridden. |
java.util.Set |
getMethodsByName(java.lang.String name)
Get the name of all methods that could be invoked through this class with a given name. |
int |
getModifiers()
Get the modifiers associated with the class. |
java.lang.String |
getName()
|
CodeClass |
getSuperClass()
|
boolean |
isArray()
Discover if the class is an array type. |
boolean |
isPrimitive()
Discover if the class represents a primitive type. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static CodeClass forClass(java.lang.Class c)
c
- the Java Class to reflect
public static CodeClass forClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- the Java class name to reflect
java.lang.ClassNotFoundException
public static CodeMethod forMethod(java.lang.reflect.Method method)
public java.lang.String getName()
getName
in interface CodeClass
public java.lang.String getJName()
getJName
in interface CodeClass
public java.lang.String getDescriptor()
getDescriptor
in interface CodeClass
public int getModifiers()
CodeClass
getModifiers
in interface CodeClass
public CodeClass getSuperClass()
getSuperClass
in interface CodeClass
public java.util.List getInterfaces()
getInterfaces
in interface CodeClass
public java.util.Set getMethods()
CodeClass
This should return methods, regardless of their accessability.
getMethods
in interface CodeClass
public CodeField getFieldByName(java.lang.String name) throws java.lang.NoSuchFieldException
CodeClass
getFieldByName
in interface CodeClass
name
- the field name
java.lang.NoSuchFieldException
- if there is no field by that name accessible
through this classpublic java.util.Set getFields()
CodeClass
getFields
in interface CodeClass
public java.util.Set getMethodsByName(java.lang.String name)
CodeClass
getMethodsByName
in interface CodeClass
name
- the name of the method
public CodeMethod getMethod(java.lang.String name, CodeClass[] args) throws java.lang.NoSuchMethodException
CodeClass
getMethod
in interface CodeClass
name
- the name of the methodargs
- the arguments it takes
java.lang.NoSuchMethodException
- if there is no maching methodpublic CodeMethod getConstructor(CodeClass[] args) throws java.lang.NoSuchMethodException
CodeClass
getConstructor
in interface CodeClass
args
- the arguments it takes
java.lang.NoSuchMethodException
- if there is no matching constructorpublic boolean isPrimitive()
CodeClass
isPrimitive
in interface CodeClass
public boolean isArray()
CodeClass
isArray
in interface CodeClass
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |