Class ClassDeclaration

java.lang.Object
org.glassfish.rmic.tools.java.ClassDeclaration
All Implemented Interfaces:
Constants, RuntimeConstants

public final class ClassDeclaration extends Object implements Constants
This class represents an Java class declaration. It refers to either a binary or source definition. ClassDefinitions are loaded on demand, this means that class declarations are late bound. The definition of the class is obtained in stages. The status field describes the state of the class definition: CS_UNDEFINED - the definition is not yet loaded CS_UNDECIDED - a binary definition is loaded, but it is still unclear if the source definition need to be loaded CS_BINARY - the binary class is loaded CS_PARSED - the class is loaded from the source file, the type information is available, but the class has not yet been compiled. CS_CHECKED - the class is loaded from the source file and has been type-checked. CS_COMPILED - the class has been type checked, compiled, and written out. CS_NOTFOUND - no class definition could be found WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
  • Field Details

    • status

      int status
    • type

      Type type
    • definition

      ClassDefinition definition
    • found

      private boolean found
      This is a flag for use by getClassDefinition(env). It is used to mark that a class has been successfully looked up by that method before.
  • Constructor Details

    • ClassDeclaration

      public ClassDeclaration(Identifier name)
      Constructor
  • Method Details

    • getStatus

      public int getStatus()
      Get the status of the class
    • getName

      public Identifier getName()
      Get the name of the class
    • getType

      public Type getType()
      Get the type of the class
    • isDefined

      public boolean isDefined()
      Check if the class is defined
    • getClassDefinition

      public ClassDefinition getClassDefinition()
      Get the definition of this class. Returns null if the class is not yet defined.
    • getClassDefinition

      public ClassDefinition getClassDefinition(Environment env) throws ClassNotFound
      Get the definition of this class, if the class is not yet defined, load the definition. Loading a class may throw various exceptions.
      Throws:
      ClassNotFound
    • getClassDefinitionNoCheck

      public ClassDefinition getClassDefinitionNoCheck(Environment env) throws ClassNotFound
      Get the definition of this class, if the class is not yet defined, load the definition. Loading a class may throw various exceptions. Perform no basicCheck() on this class.
      Throws:
      ClassNotFound
    • setDefinition

      public void setDefinition(ClassDefinition definition, int status)
      Set the class definition
    • equals

      public boolean equals(Object obj)
      Equality
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      toString
      Overrides:
      toString in class Object