public final class

ClassDeclaration

extends Object
implements Constants
java.lang.Object
   ↳ sun.tools.java.ClassDeclaration

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
[Expand]
Inherited Fields
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
Public Constructors
ClassDeclaration(Identifier name)
Constructor
Public Methods
boolean equals(Object obj)
Equality
ClassDefinition getClassDefinition()
Get the definition of this class.
ClassDefinition getClassDefinition(Environment env)
Get the definition of this class, if the class is not yet defined, load the definition.
ClassDefinition getClassDefinitionNoCheck(Environment env)
Get the definition of this class, if the class is not yet defined, load the definition.
Identifier getName()
Get the name of the class
int getStatus()
Get the status of the class
Type getType()
Get the type of the class
boolean isDefined()
Check if the class is defined
void setDefinition(ClassDefinition definition, int status)
Set the class definition
String toString()
toString
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClassDeclaration (Identifier name)

Constructor

Public Methods

public boolean equals (Object obj)

Equality

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public ClassDefinition getClassDefinition ()

Get the definition of this class. Returns null if the class is not yet defined.

public ClassDefinition getClassDefinition (Environment env)

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

public ClassDefinition getClassDefinitionNoCheck (Environment env)

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

public Identifier getName ()

Get the name of the class

public int getStatus ()

Get the status of the class

public Type getType ()

Get the type of the class

public boolean isDefined ()

Check if the class is defined

public void setDefinition (ClassDefinition definition, int status)

Set the class definition

public String toString ()

toString

Returns
  • a string representation of the object.