org.aspectj.org.eclipse.jdt.internal.core
Class CompilationUnitStructureRequestor

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter
      extended by org.aspectj.org.eclipse.jdt.internal.core.CompilationUnitStructureRequestor
All Implemented Interfaces:
ISourceElementRequestor
Direct Known Subclasses:
CompletionUnitStructureRequestor

public class CompilationUnitStructureRequestor
extends ReferenceInfoAdapter
implements ISourceElementRequestor

A requestor for the fuzzy parser, used to compute the children of an ICompilationUnit.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.ISourceElementRequestor
ISourceElementRequestor.FieldInfo, ISourceElementRequestor.MethodInfo, ISourceElementRequestor.ParameterInfo, ISourceElementRequestor.TypeInfo, ISourceElementRequestor.TypeParameterInfo
 
Field Summary
protected  java.util.HashMap children
           
protected  HashtableOfObject fieldRefCache
           
protected  java.util.Stack handleStack
          Stack of parent handles, corresponding to the info stack.
protected  boolean hasSyntaxErrors
          Problem requestor which will get notified of discovered problems
protected  ImportContainer importContainer
           
protected  ImportContainerInfo importContainerInfo
          The import container info - null until created
protected  java.util.Stack infoStack
          Stack of parent scope info objects.
protected  HashtableOfObject messageRefCache
           
protected  java.util.Map newElements
          Hashtable of children elements of the compilation unit.
protected  Parser parser
           
protected  int referenceCount
          The number of references reported thus far.
protected  HashtableOfObject typeRefCache
           
protected  ICompilationUnit unit
          The handle to the compilation unit being parsed
protected  CompilationUnitElementInfo unitInfo
          The info object for the compilation unit being parsed
protected  HashtableOfObject unknownRefCache
           
 
Constructor Summary
protected CompilationUnitStructureRequestor(ICompilationUnit unit, CompilationUnitElementInfo unitInfo, java.util.Map newElements)
           
 
Method Summary
protected  IAnnotation acceptAnnotation(Annotation annotation, AnnotatableInfo parentInfo, JavaElement parentHandle)
           
 void acceptImport(int declarationStart, int declarationEnd, int nameSourceStart, int nameSourceEnd, char[][] tokens, boolean onDemand, int modifiers)
           
 void acceptLineSeparatorPositions(int[] positions)
           
 void acceptPackage(ImportReference importReference)
           
 void acceptProblem(CategorizedProblem problem)
           
protected  void acceptTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo, JavaElementInfo parentInfo)
           
protected static java.lang.String[] convertTypeNamesToSigs(char[][] typeNames)
          Convert these type names to signatures.
protected  Annotation createAnnotation(JavaElement parent, java.lang.String name)
           
protected  SourceField createField(JavaElement parent, ISourceElementRequestor.FieldInfo fieldInfo)
           
protected  ImportContainer createImportContainer(ICompilationUnit parent)
           
protected  ImportDeclaration createImportDeclaration(ImportContainer parent, java.lang.String name, boolean onDemand)
           
protected  Initializer createInitializer(JavaElement parent)
           
protected  SourceMethod createMethodHandle(JavaElement parent, ISourceElementRequestor.MethodInfo methodInfo)
           
protected  PackageDeclaration createPackageDeclaration(JavaElement parent, java.lang.String name)
           
protected  SourceType createTypeHandle(JavaElement parent, ISourceElementRequestor.TypeInfo typeInfo)
           
protected  TypeParameter createTypeParameter(JavaElement parent, java.lang.String name)
           
 void enterCompilationUnit()
           
 void enterConstructor(ISourceElementRequestor.MethodInfo methodInfo)
           
 void enterField(ISourceElementRequestor.FieldInfo fieldInfo)
           
 void enterInitializer(int declarationSourceStart, int modifiers)
           
 void enterMethod(ISourceElementRequestor.MethodInfo methodInfo)
           
 void enterType(ISourceElementRequestor.TypeInfo typeInfo)
           
 void exitCompilationUnit(int declarationEnd)
           
 void exitConstructor(int declarationEnd)
           
 void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd)
           
 void exitInitializer(int declarationEnd)
           
 void exitMethod(int declarationEnd, Expression defaultValue)
           
 void exitType(int declarationEnd)
           
protected  java.lang.Object getMemberValue(MemberValuePair memberValuePair, Expression expression)
           
protected  IMemberValuePair getMemberValuePair(MemberValuePair memberValuePair)
           
protected  IMemberValuePair[] getMemberValuePairs(MemberValuePair[] memberValuePairs)
           
protected  void resolveDuplicates(SourceRefElement handle)
          Resolves duplicate handles by incrementing the occurrence count of the handle being created.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter
acceptAnnotationTypeReference, acceptAnnotationTypeReference, acceptConstructorReference, acceptFieldReference, acceptMethodReference, acceptTypeReference, acceptTypeReference, acceptUnknownReference, acceptUnknownReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.ISourceElementRequestor
acceptAnnotationTypeReference, acceptAnnotationTypeReference, acceptConstructorReference, acceptFieldReference, acceptMethodReference, acceptTypeReference, acceptTypeReference, acceptUnknownReference, acceptUnknownReference
 

Field Detail

unit

protected ICompilationUnit unit
The handle to the compilation unit being parsed


unitInfo

protected CompilationUnitElementInfo unitInfo
The info object for the compilation unit being parsed


importContainerInfo

protected ImportContainerInfo importContainerInfo
The import container info - null until created


importContainer

protected ImportContainer importContainer

newElements

protected java.util.Map newElements
Hashtable of children elements of the compilation unit. Children are added to the table as they are found by the parser. Keys are handles, values are corresponding info objects.


infoStack

protected java.util.Stack infoStack
Stack of parent scope info objects. The info on the top of the stack is the parent of the next element found. For example, when we locate a method, the parent info object will be the type the method is contained in.


children

protected java.util.HashMap children

handleStack

protected java.util.Stack handleStack
Stack of parent handles, corresponding to the info stack. We keep both, since info objects do not have back pointers to handles.


referenceCount

protected int referenceCount
The number of references reported thus far. Used to expand the arrays of reference kinds and names.


hasSyntaxErrors

protected boolean hasSyntaxErrors
Problem requestor which will get notified of discovered problems


parser

protected Parser parser

fieldRefCache

protected HashtableOfObject fieldRefCache

messageRefCache

protected HashtableOfObject messageRefCache

typeRefCache

protected HashtableOfObject typeRefCache

unknownRefCache

protected HashtableOfObject unknownRefCache
Constructor Detail

CompilationUnitStructureRequestor

protected CompilationUnitStructureRequestor(ICompilationUnit unit,
                                            CompilationUnitElementInfo unitInfo,
                                            java.util.Map newElements)
Method Detail

acceptImport

public void acceptImport(int declarationStart,
                         int declarationEnd,
                         int nameSourceStart,
                         int nameSourceEnd,
                         char[][] tokens,
                         boolean onDemand,
                         int modifiers)
Specified by:
acceptImport in interface ISourceElementRequestor
Parameters:
declarationStart - This is the position of the first character of the import keyword.
declarationEnd - This is the position of the ';' ending the import statement or the end of the comment following the import.
nameSourceStart - This is the position of the first character of the import declaration's name.
nameSourceEnd - This is the position of the last character of the import declaration's name.
tokens - This are the tokens of the import like specified in the source.
onDemand - set to true if the import is an import on demand (e.g. import java.io.*). False otherwise.
modifiers - can be set to static from 1.5 on.
See Also:
ISourceElementRequestor

acceptLineSeparatorPositions

public void acceptLineSeparatorPositions(int[] positions)
Specified by:
acceptLineSeparatorPositions in interface ISourceElementRequestor

acceptPackage

public void acceptPackage(ImportReference importReference)
Specified by:
acceptPackage in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

acceptProblem

public void acceptProblem(CategorizedProblem problem)
Specified by:
acceptProblem in interface ISourceElementRequestor

createAnnotation

protected Annotation createAnnotation(JavaElement parent,
                                      java.lang.String name)

createField

protected SourceField createField(JavaElement parent,
                                  ISourceElementRequestor.FieldInfo fieldInfo)

createImportContainer

protected ImportContainer createImportContainer(ICompilationUnit parent)

createImportDeclaration

protected ImportDeclaration createImportDeclaration(ImportContainer parent,
                                                    java.lang.String name,
                                                    boolean onDemand)

createInitializer

protected Initializer createInitializer(JavaElement parent)

createMethodHandle

protected SourceMethod createMethodHandle(JavaElement parent,
                                          ISourceElementRequestor.MethodInfo methodInfo)

createPackageDeclaration

protected PackageDeclaration createPackageDeclaration(JavaElement parent,
                                                      java.lang.String name)

createTypeHandle

protected SourceType createTypeHandle(JavaElement parent,
                                      ISourceElementRequestor.TypeInfo typeInfo)

createTypeParameter

protected TypeParameter createTypeParameter(JavaElement parent,
                                            java.lang.String name)

convertTypeNamesToSigs

protected static java.lang.String[] convertTypeNamesToSigs(char[][] typeNames)
Convert these type names to signatures.

See Also:
Signature

acceptAnnotation

protected IAnnotation acceptAnnotation(Annotation annotation,
                                       AnnotatableInfo parentInfo,
                                       JavaElement parentHandle)

enterCompilationUnit

public void enterCompilationUnit()
Specified by:
enterCompilationUnit in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterConstructor

public void enterConstructor(ISourceElementRequestor.MethodInfo methodInfo)
Specified by:
enterConstructor in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterField

public void enterField(ISourceElementRequestor.FieldInfo fieldInfo)
Specified by:
enterField in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterInitializer

public void enterInitializer(int declarationSourceStart,
                             int modifiers)
Specified by:
enterInitializer in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterMethod

public void enterMethod(ISourceElementRequestor.MethodInfo methodInfo)
Specified by:
enterMethod in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

enterType

public void enterType(ISourceElementRequestor.TypeInfo typeInfo)
Specified by:
enterType in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

acceptTypeParameter

protected void acceptTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo,
                                   JavaElementInfo parentInfo)

exitCompilationUnit

public void exitCompilationUnit(int declarationEnd)
Specified by:
exitCompilationUnit in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitConstructor

public void exitConstructor(int declarationEnd)
Specified by:
exitConstructor in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitField

public void exitField(int initializationStart,
                      int declarationEnd,
                      int declarationSourceEnd)
Specified by:
exitField in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitInitializer

public void exitInitializer(int declarationEnd)
Specified by:
exitInitializer in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitMethod

public void exitMethod(int declarationEnd,
                       Expression defaultValue)
Specified by:
exitMethod in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

exitType

public void exitType(int declarationEnd)
Specified by:
exitType in interface ISourceElementRequestor
See Also:
ISourceElementRequestor

resolveDuplicates

protected void resolveDuplicates(SourceRefElement handle)
Resolves duplicate handles by incrementing the occurrence count of the handle being created.


getMemberValuePair

protected IMemberValuePair getMemberValuePair(MemberValuePair memberValuePair)

getMemberValuePairs

protected IMemberValuePair[] getMemberValuePairs(MemberValuePair[] memberValuePairs)

getMemberValue

protected java.lang.Object getMemberValue(MemberValuePair memberValuePair,
                                          Expression expression)