org.aspectj.compiler.base.ast
Class CompilationUnit
java.lang.Object
org.aspectj.compiler.base.CompilerObject
org.aspectj.compiler.base.ast.ASTObject
org.aspectj.compiler.base.ast.CompilationUnit
- Direct Known Subclasses:
- MajCompilationUnit
- public class CompilationUnit
- extends ASTObject
Methods inherited from class org.aspectj.compiler.base.ast.ASTObject |
addComment, buildAccessMethod, checkNoSharing, clearComment, clearParent, contains, containsTypes, copy, display, fixAccessPost, fixAST, fromSource, getAST, getBeginColumn, getBeginLine, getBytecodeType, getComment, getEnclosingDec, getEndColumn, getEndLine, getEndPosition, getFormalComment, getOutermostBytecodeType, getOutermostLexicalType, getParent, getSourceDirectoryName, getSourceFileName, getSourceLocation, getStartPosition, hasLegalProtectedAccess, hasSource, hasSourceLocation, implementMixin, indexOf, inStaticContext, isLanguageVisible, isLeaf, isSynthetic, makeChild, makeChild, postAssignmentCheck, postCleanup, postCopy, postFixAST, postImplementMixin, postInnerAccess, postInnerInfo, postLift, postMove, postScope, postThreading, preAssignmentCheck, preCopy, preIntroduction, preLift, preMove, preThreading, remove, remove, removeChildAt, replaceWith, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toShortString, unparse, walk, walkAnalysis, walkAssignmentCheck, walkCleanup, walkFlow, walkForwardReference, walkFrameLoc, walkInnerInfo, walkMemberMunger, walkScope |
Methods inherited from class org.aspectj.compiler.base.CompilerObject |
getCompiler, getOptions, getTypeManager, getWorld |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
packageName
protected java.lang.String packageName
imports
protected Imports imports
decs
protected Decs decs
sourceInfo
protected org.aspectj.compiler.base.parser.SourceInfo sourceInfo
scanned
protected boolean scanned
CompilationUnit
public CompilationUnit(org.aspectj.compiler.base.JavaCompiler compiler,
java.io.File _file)
CompilationUnit
public CompilationUnit(SourceLocation location,
java.lang.String _packageName,
Imports _imports,
Decs _decs,
org.aspectj.compiler.base.parser.SourceInfo _sourceInfo,
boolean _scanned)
CompilationUnit
protected CompilationUnit(SourceLocation source)
getDefinedTypes
public java.util.List getDefinedTypes()
addDefinedType
public void addDefinedType(TypeDec dec)
getDeclaringType
public Type getDeclaringType()
- Description copied from class:
ASTObject
- returns the declaring type of a method. For non-static methods, this type
will always be the type of 'this' within the method. For static methods, this
type will always be the type used to name the method for outside
of its scope, i.e. DeclaringType.m()
For a comparision with getLexicalType() and getBytecodeTypeDec() see
getLexicalType().
- Overrides:
getDeclaringType
in class ASTObject
getLexicalType
public Type getLexicalType()
- Description copied from class:
ASTObject
- returns the lexically enclosing Type for this object.
For pure Java code this is always identical to getDeclaringType() and
getBytecodeTypeDec().getType().
For introduced methods, this can be different, i.e.
interface I { }
class C implements I { }
aspect A {
void C.m() { ... }
}
For the method I.m() implemented in C and for any ASTObjects inside of it,
getLexicalType() == A
getDeclaringType() == I
getBytecodeTypeDec().getType() == C
- Overrides:
getLexicalType
in class ASTObject
getBytecodeTypeDec
public TypeDec getBytecodeTypeDec()
- Description copied from class:
ASTObject
- not part of the language's semantic model, but part of the compiler's
generated code model. This will return the type declaration
that will actually be
enclosing this point in the bytecodes produced by the compiler.
- Overrides:
getBytecodeTypeDec
in class ASTObject
getEnclosingCodeDec
public CodeDec getEnclosingCodeDec()
- Overrides:
getEnclosingCodeDec
in class ASTObject
getScope
public org.aspectj.compiler.base.cst.CUScope getScope()
preScope
public void preScope(ScopeWalker walker)
- Overrides:
preScope
in class ASTObject
toString
public java.lang.String toString()
- Overrides:
toString
in class ASTObject
cleanup
public void cleanup()
- Overrides:
cleanup
in class ASTObject
cleanupDefinedTypes
public void cleanupDefinedTypes()
getSourceCanonicalPath
public java.lang.String getSourceCanonicalPath()
getSourceDirectory
public java.lang.String getSourceDirectory()
getSourceFile
public java.io.File getSourceFile()
- Overrides:
getSourceFile
in class ASTObject
getLine
public int getLine(int position)
getColumn
public int getColumn(int position)
getCompilationUnit
public CompilationUnit getCompilationUnit()
- Overrides:
getCompilationUnit
in class ASTObject
addTypesToTypeGraph
public void addTypesToTypeGraph()
buildSignatures
public void buildSignatures()
checkSpec
public void checkSpec()
- Overrides:
checkSpec
in class ASTObject
unparse
public void unparse(org.aspectj.compiler.base.CodeWriter writer)
- Overrides:
unparse
in class ASTObject
generateBytecode
public final void generateBytecode(java.io.File outputDir)
throws java.io.IOException
- Throws:
java.io.IOException
getPackageName
public java.lang.String getPackageName()
setPackageName
public void setPackageName(java.lang.String _packageName)
getImports
public Imports getImports()
setImports
public void setImports(Imports _imports)
getDecs
public Decs getDecs()
setDecs
public void setDecs(Decs _decs)
getSourceInfo
public org.aspectj.compiler.base.parser.SourceInfo getSourceInfo()
setSourceInfo
public void setSourceInfo(org.aspectj.compiler.base.parser.SourceInfo _sourceInfo)
getScanned
public boolean getScanned()
setScanned
public void setScanned(boolean _scanned)
copyWalk
public ASTObject copyWalk(CopyWalker walker)
- Overrides:
copyWalk
in class ASTObject
getChildAt
public ASTObject getChildAt(int childIndex)
- Overrides:
getChildAt
in class ASTObject
getChildNameAt
public java.lang.String getChildNameAt(int childIndex)
- Overrides:
getChildNameAt
in class ASTObject
setChildAt
public void setChildAt(int childIndex,
ASTObject child)
- Overrides:
setChildAt
in class ASTObject
getChildCount
public int getChildCount()
- Overrides:
getChildCount
in class ASTObject
getDefaultDisplayName
public java.lang.String getDefaultDisplayName()
- Overrides:
getDefaultDisplayName
in class ASTObject