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

    • getJName

    • getDescriptor

    • getSuperClass

    • getInterfaces

    • 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 method
      args - 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

      Get all fields accessible through this class.
      Returns:
      a Set of all accessible fields
    • 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