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 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

      Set getMethodsByName(String name)
      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

      CodeMethod getMethod(String name, CodeClass[] args) throws NoSuchMethodException
      Get a method by name and argument list.
      Parameters:
      name - the name of the method
      args - the arguments it takes
      Returns:
      a matching method
      Throws:
      NoSuchMethodException - if there is no maching method
    • getConstructor

      CodeMethod getConstructor(CodeClass[] args) throws NoSuchMethodException
      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

      CodeField getFieldByName(String name) throws NoSuchFieldException
      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