Class BClass


  • public class BClass
    extends java.lang.Object
    A wrapper for a class. This is used to represent both classes which have a representation within the BlueJ project, and those that don't.

    From an instance of this class, an extension can create BlueJ objects and call their methods. Behaviour is similar to the Java reflection API.

    Author:
    Damiano Bolla, University of Kent at Canterbury, 2002,2003,2004
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void compile​(boolean waitCompileEnd)
      Compiles this class, and any dependents.
      void compile​(boolean waitCompileEnd, boolean forceQuiet)
      Compiles this class, and any dependents, optionally without showing compilation errors to the user.
      void convertJavaToStride()
      Converts a Java class to Stride.
      void convertStrideToJava()
      Converts a Stride class to Java, by removing the Stride file and retaining the generated Java.
      java.io.File getClassFile()
      Returns this class's .class file.
      BConstructor getConstructor​(java.lang.Class<?>[] signature)
      Returns the constructor for this class which has the given signature.
      BConstructor[] getConstructors()
      Returns all the constructors of this class.
      BMethod getDeclaredMethod​(java.lang.String methodName, java.lang.Class<?>[] params)
      Returns the declared method of this class which has the given signature.
      BMethod[] getDeclaredMethods()
      Returns the declared methods of this class.
      BField getField​(java.lang.String fieldName)
      Returns the field of this class which has the given name.
      BField[] getFields()
      Returns all the fields of this class.
      java.lang.Class<?> getJavaClass()
      Returns the Java Class object being wrapped by this BClass.
      JavaEditor getJavaEditor()
      Returns a proxy object that provide an interface to the Java editor for this BClass.
      JavaEditor getJavaEditorIfOpen()
      Returns a proxy object that provide an interface to the Java editor for this BClass.
      java.io.File getJavaFile()
      Returns this class's .java file.
      BMethod getMethod​(java.lang.String methodName, java.lang.Class<?>[] params)
      Returns the method of this class with the given signature.
      BMethod[] getMethods()
      Returns all methods of this class, those declared and those inherited from all ancestors.
      java.lang.String getName()
      Returns the name of this BClass.
      BPackage getPackage()
      Returns the BPackage this class belongs to.
      SourceType getSourceType()
      Finds out whether this class has source code available, and whether it's Java or Stride
      StrideEditor getStrideEditor()
      Returns a proxy object that provide an interface to the Stride editor for this BClass.
      StrideEditor getStrideEditorIfOpen()
      Returns a proxy object that provide an interface to the Stride editor for this BClass.
      BClass getSuperclass()
      Returns the superclass of this class.
      boolean isCompiled()
      Checks to see if this class has been compiled.
      void remove()
      Removes this class from BlueJ, including the underlying files.
      java.lang.String toString()
      Returns a string representation of the Object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait