Package org.biojava.utils.bytecode
Interface CodeClass
- All Known Implementing Classes:
GeneratedCodeClass
,IntrospectedCodeClass
public interface CodeClass
Interface for Java classes within the bytecode generation framework.
Any class (or interface) can be viewed as a CodeClass, whether it
is pre-existing or being generated.
- Author:
- Thomas Down, Matthew Pocock
-
Method Summary
Modifier and TypeMethodDescriptiongetConstructor
(CodeClass[] args) Get a constructor by argument list.getFieldByName
(String name) Get a field by its name.Get all fields accessible through this class.getJName()
Get a method by name and argument list.Get all methods declared by this class and its super classes, removing all super class methods that are over ridden.getMethodsByName
(String name) Get the name of all methods that could be invoked through this class with a given name.int
Get the modifiers associated with the class.getName()
boolean
isArray()
Discover if the class is an array type.boolean
Discover if the class represents a primitive type.
-
Method Details
-
getName
String getName() -
getJName
String getJName() -
getDescriptor
String getDescriptor() -
getSuperClass
CodeClass getSuperClass() -
getInterfaces
List getInterfaces() -
getMethods
Set getMethods()Get all methods declared by this class and its super classes, removing all super class methods that are over ridden.This should return methods, regardless of their accessability.
- Returns:
- a Set containing all methods
-
getMethodsByName
Get the name of all methods that could be invoked through this class with a given name.- Parameters:
name
- the name of the method- Returns:
- a Set of CodeMethod instances with that name
-
getMethod
Get a method by name and argument list.- Parameters:
name
- the name of the methodargs
- the arguments it takes- Returns:
- a matching method
- Throws:
NoSuchMethodException
- if there is no maching method
-
getConstructor
Get a constructor by argument list.- Parameters:
args
- the arguments it takes- Returns:
- a matching constructor
- Throws:
NoSuchMethodException
- if there is no matching constructor
-
getFieldByName
Get a field by its name.- Parameters:
name
- the field name- Returns:
- a CodeField representing the field
- Throws:
NoSuchFieldException
- if there is no field by that name accessible through this class
-
getFields
Set getFields()Get all fields accessible through this class.- Returns:
- a Set of all accessible fields
-
getModifiers
int getModifiers()Get the modifiers associated with the class.- Returns:
- the modifier integer
-
isPrimitive
boolean isPrimitive()Discover if the class represents a primitive type.- Returns:
- true if the class represents a primative type
-
isArray
boolean isArray()Discover if the class is an array type.- Returns:
- true if the class is an array type
-