public class

SourceClass

extends ClassDefinition
java.lang.Object
   ↳ sun.tools.java.ClassDefinition
     ↳ sun.tools.javac.SourceClass

Class Overview

This class represents an Java class as it is read from an Java source file. 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 class sun.tools.java.ClassDefinition
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
Public Constructors
SourceClass(Environment env, long where, ClassDeclaration declaration, String documentation, int modifiers, IdentifierToken superClass, IdentifierToken[] interfaces, SourceClass outerClass, Identifier localName)
Constructor
Public Methods
void addDependency(ClassDeclaration c)
Add a dependency
void addMember(Environment env, MemberDefinition f)
Add a field (check it first)
void check(Environment env)
Check this class and all its fields.
Vset checkInsideClass(Environment env, Context ctx, Vset vset)
Check a class which is inside a local class, but is not itself local.
Vset checkLocalClass(Environment env, Context ctx, Vset vset, ClassDefinition sup, Expression[] args, Type[] argTypes)
During the type-checking of an outer method body or initializer, this routine is called to check a local class body in the proper context.
void checkSourceFile(Environment env, long where)
See if the source file of this class is of the right name.
void compile(OutputStream out)
Compile this class
String getAbsoluteName()
Return absolute name of source file
MemberDefinition getAccessMember(Environment env, Context ctx, MemberDefinition field, boolean isSuper)
Find or create an access method for a private member, or return null if this is not possible.
MemberDefinition getClassLiteralLookup(long fwhere)
Get helper method for class literal lookup.
long getEndPosition()
Return last position in this class.
Imports getImports()
Return imports
ClassDeclaration getSuperClass(Environment env)
Overrides 'ClassDefinition.getSuperClass'.
LocalMember getThisArgument()
Find or create my "this" argument, which is used for all methods.
MemberDefinition getUpdateMember(Environment env, Context ctx, MemberDefinition field, boolean isSuper)
Find or create an update method for a private member, or return null if this is not possible.
void inlineLocalClass(Environment env)
As with checkLocalClass, run the inline phase for a local class.
void noteUsedBy(ClassDefinition ref, long where, Environment env)
See if the source file of this class is right.
void printClassDependencies(Environment env)
Print out the dependencies for this class (-xdepend) option
boolean reportDeprecated(Environment env)
A source class never reports deprecation, since the compiler allows access to deprecated features that are being compiled in the same job.
void resolveTypeStructure(Environment env)
We create a stub for this.
void setEndPosition(long endPosition)
Environment setupEnv(Environment env)
Create an environment suitable for checking this class.
Protected Methods
void addMirandaMethods(Environment env, Iterator mirandas)
Add a group of methods to this class as miranda methods.
void basicCheck(Environment env)
void compileClass(Environment env, OutputStream out)
void resolveSupers(Environment env)
[Expand]
Inherited Methods
From class sun.tools.java.ClassDefinition
From class java.lang.Object

Public Constructors

public SourceClass (Environment env, long where, ClassDeclaration declaration, String documentation, int modifiers, IdentifierToken superClass, IdentifierToken[] interfaces, SourceClass outerClass, Identifier localName)

Constructor

Public Methods

public void addDependency (ClassDeclaration c)

Add a dependency

public void addMember (Environment env, MemberDefinition f)

Add a field (check it first)

public void check (Environment env)

Check this class and all its fields.

Throws
ClassNotFound

public Vset checkInsideClass (Environment env, Context ctx, Vset vset)

Check a class which is inside a local class, but is not itself local.

Throws
ClassNotFound

public Vset checkLocalClass (Environment env, Context ctx, Vset vset, ClassDefinition sup, Expression[] args, Type[] argTypes)

During the type-checking of an outer method body or initializer, this routine is called to check a local class body in the proper context.

Parameters
sup the named super class or interface (if anonymous)
args the actual arguments (if anonymous)
Throws
ClassNotFound

public void checkSourceFile (Environment env, long where)

See if the source file of this class is of the right name.

public void compile (OutputStream out)

Compile this class

public String getAbsoluteName ()

Return absolute name of source file

public MemberDefinition getAccessMember (Environment env, Context ctx, MemberDefinition field, boolean isSuper)

Find or create an access method for a private member, or return null if this is not possible.

public MemberDefinition getClassLiteralLookup (long fwhere)

Get helper method for class literal lookup.

public long getEndPosition ()

Return last position in this class.

See Also

public Imports getImports ()

Return imports

public ClassDeclaration getSuperClass (Environment env)

Overrides 'ClassDefinition.getSuperClass'.

public LocalMember getThisArgument ()

Find or create my "this" argument, which is used for all methods.

public MemberDefinition getUpdateMember (Environment env, Context ctx, MemberDefinition field, boolean isSuper)

Find or create an update method for a private member, or return null if this is not possible.

public void inlineLocalClass (Environment env)

As with checkLocalClass, run the inline phase for a local class.

public void noteUsedBy (ClassDefinition ref, long where, Environment env)

See if the source file of this class is right.

public void printClassDependencies (Environment env)

Print out the dependencies for this class (-xdepend) option

public boolean reportDeprecated (Environment env)

A source class never reports deprecation, since the compiler allows access to deprecated features that are being compiled in the same job.

public void resolveTypeStructure (Environment env)

We create a stub for this. Source classes do more work. Some calls from 'SourceClass.checkSupers' execute this method.

public void setEndPosition (long endPosition)

public Environment setupEnv (Environment env)

Create an environment suitable for checking this class. Make sure the source and imports are set right. Make sure the environment contains no context information. (Actually, throw away env altogether and use toplevelEnv instead.)

Protected Methods

protected void addMirandaMethods (Environment env, Iterator mirandas)

Add a group of methods to this class as miranda methods. For a definition of Miranda methods, see the comment above the method addMirandaMethods() in the file sun/tools/java/ClassDeclaration.java

protected void basicCheck (Environment env)

Throws
ClassNotFound

protected void compileClass (Environment env, OutputStream out)

protected void resolveSupers (Environment env)