Class CompilationUnitStructureRequestor
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter
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.ModuleInfo, ISourceElementRequestor.PackageExportInfo, ISourceElementRequestor.ParameterInfo, ISourceElementRequestor.RequiresInfo, ISourceElementRequestor.ServicesInfo, ISourceElementRequestor.TypeInfo, ISourceElementRequestor.TypeParameterInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMap<Object, List<IJavaElement>> protected HashtableOfObjectprotected Stack<IJavaElement> Stack of parent handles, corresponding to the info stack.protected booleanProblem requestor which will get notified of discovered problemsprotected ImportContainerprotected ImportContainerInfoThe import container info - null until createdStack of parent scope info objects.protected HashtableOfObjectprotected Map<IJavaElement, IElementInfo> Map of children elements of the compilation unit.protected Parserprotected intThe number of references reported thus far.protected HashtableOfObjectprotected ICompilationUnitThe handle to the compilation unit being parsedprotected CompilationUnitElementInfoThe info object for the compilation unit being parsedprotected HashtableOfObject -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompilationUnitStructureRequestor(ICompilationUnit unit, CompilationUnitElementInfo unitInfo, Map<IJavaElement, IElementInfo> newElements) -
Method Summary
Modifier and TypeMethodDescriptionprotected IAnnotationacceptAnnotation(Annotation annotation, AnnotatableInfo parentInfo, JavaElement parentHandle) voidacceptImport(int declarationStart, int declarationEnd, int nameSourceStart, int nameSourceEnd, char[][] tokens, boolean onDemand, int modifiers) voidacceptLineSeparatorPositions(int[] positions) voidacceptPackage(ImportReference importReference) voidacceptProblem(CategorizedProblem problem) protected voidacceptTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo, JavaElementInfo parentInfo) protected static String[]convertTypeNamesToSigs(char[][] typeNames) Convert these type names to signatures.protected AnnotationcreateAnnotation(JavaElement parent, String name) protected SourceFieldcreateField(JavaElement parent, ISourceElementRequestor.FieldInfo fieldInfo) protected ImportContainerprotected ImportDeclarationcreateImportDeclaration(ImportContainer parent, String name, boolean onDemand) protected InitializercreateInitializer(JavaElement parent) protected SourceMethodcreateMethodHandle(JavaElement parent, ISourceElementRequestor.MethodInfo methodInfo) protected SourceModulecreateModuleHandle(JavaElement parent, ISourceElementRequestor.ModuleInfo modInfo) protected PackageDeclarationcreatePackageDeclaration(JavaElement parent, String name) protected SourceFieldcreateRecordComponent(JavaElement parent, ISourceElementRequestor.FieldInfo compInfo) protected SourceTypecreateTypeHandle(JavaElement parent, ISourceElementRequestor.TypeInfo typeInfo) protected TypeParametercreateTypeParameter(JavaElement parent, String name) voidvoidenterConstructor(ISourceElementRequestor.MethodInfo methodInfo) voidenterField(ISourceElementRequestor.FieldInfo fieldInfo) voidenterInitializer(int declarationSourceStart, int modifiers) voidenterMethod(ISourceElementRequestor.MethodInfo methodInfo) voidvoidenterType(ISourceElementRequestor.TypeInfo typeInfo) voidexitCompilationUnit(int declarationEnd) voidexitConstructor(int declarationEnd) voidexitField(int initializationStart, int declarationEnd, int declarationSourceEnd) voidexitInitializer(int declarationEnd) voidexitMethod(int declarationEnd, Expression defaultValue) voidexitModule(int declarationEnd) voidexitType(int declarationEnd) protected ObjectgetMemberValue(MemberValuePair memberValuePair, Expression expression) protected IMemberValuePairgetMemberValuePair(MemberValuePair memberValuePair) protected IMemberValuePair[]getMemberValuePairs(MemberValuePair[] memberValuePairs) protected voidresolveDuplicates(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, acceptUnknownReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.ISourceElementRequestor
acceptAnnotationTypeReference, acceptAnnotationTypeReference, acceptConstructorReference, acceptFieldReference, acceptMethodReference, acceptTypeReference, acceptTypeReference, acceptUnknownReference, acceptUnknownReference, enterCompactConstructor, exitCompactConstructor
-
Field Details
-
unit
The handle to the compilation unit being parsed -
unitInfo
The info object for the compilation unit being parsed -
importContainerInfo
The import container info - null until created -
importContainer
-
newElements
Map 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
-
children
-
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 referenceCountThe number of references reported thus far. Used to expand the arrays of reference kinds and names. -
hasSyntaxErrors
protected boolean hasSyntaxErrorsProblem requestor which will get notified of discovered problems -
parser
-
fieldRefCache
-
messageRefCache
-
typeRefCache
-
unknownRefCache
-
-
Constructor Details
-
CompilationUnitStructureRequestor
protected CompilationUnitStructureRequestor(ICompilationUnit unit, CompilationUnitElementInfo unitInfo, Map<IJavaElement, IElementInfo> newElements)
-
-
Method Details
-
acceptImport
public void acceptImport(int declarationStart, int declarationEnd, int nameSourceStart, int nameSourceEnd, char[][] tokens, boolean onDemand, int modifiers) - Specified by:
acceptImportin interfaceISourceElementRequestor- 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:
-
acceptLineSeparatorPositions
public void acceptLineSeparatorPositions(int[] positions) - Specified by:
acceptLineSeparatorPositionsin interfaceISourceElementRequestor
-
acceptPackage
- Specified by:
acceptPackagein interfaceISourceElementRequestor- See Also:
-
acceptProblem
- Specified by:
acceptProblemin interfaceISourceElementRequestor
-
createAnnotation
-
createField
-
createRecordComponent
protected SourceField createRecordComponent(JavaElement parent, ISourceElementRequestor.FieldInfo compInfo) -
createImportContainer
-
createImportDeclaration
protected ImportDeclaration createImportDeclaration(ImportContainer parent, String name, boolean onDemand) -
createInitializer
-
createMethodHandle
protected SourceMethod createMethodHandle(JavaElement parent, ISourceElementRequestor.MethodInfo methodInfo) -
createPackageDeclaration
-
createTypeHandle
protected SourceType createTypeHandle(JavaElement parent, ISourceElementRequestor.TypeInfo typeInfo) -
createModuleHandle
protected SourceModule createModuleHandle(JavaElement parent, ISourceElementRequestor.ModuleInfo modInfo) -
createTypeParameter
-
convertTypeNamesToSigs
Convert these type names to signatures.- See Also:
-
acceptAnnotation
protected IAnnotation acceptAnnotation(Annotation annotation, AnnotatableInfo parentInfo, JavaElement parentHandle) -
enterCompilationUnit
public void enterCompilationUnit()- Specified by:
enterCompilationUnitin interfaceISourceElementRequestor- See Also:
-
enterConstructor
- Specified by:
enterConstructorin interfaceISourceElementRequestor- See Also:
-
enterField
- Specified by:
enterFieldin interfaceISourceElementRequestor- See Also:
-
enterInitializer
public void enterInitializer(int declarationSourceStart, int modifiers) - Specified by:
enterInitializerin interfaceISourceElementRequestor- See Also:
-
enterMethod
- Specified by:
enterMethodin interfaceISourceElementRequestor- See Also:
-
enterModule
- Specified by:
enterModulein interfaceISourceElementRequestor
-
enterType
- Specified by:
enterTypein interfaceISourceElementRequestor- See Also:
-
acceptTypeParameter
protected void acceptTypeParameter(ISourceElementRequestor.TypeParameterInfo typeParameterInfo, JavaElementInfo parentInfo) -
exitCompilationUnit
public void exitCompilationUnit(int declarationEnd) - Specified by:
exitCompilationUnitin interfaceISourceElementRequestor- See Also:
-
exitConstructor
public void exitConstructor(int declarationEnd) - Specified by:
exitConstructorin interfaceISourceElementRequestor- See Also:
-
exitField
public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) - Specified by:
exitFieldin interfaceISourceElementRequestor- See Also:
-
exitInitializer
public void exitInitializer(int declarationEnd) - Specified by:
exitInitializerin interfaceISourceElementRequestor- See Also:
-
exitMethod
- Specified by:
exitMethodin interfaceISourceElementRequestor- See Also:
-
exitModule
public void exitModule(int declarationEnd) - Specified by:
exitModulein interfaceISourceElementRequestor
-
exitType
public void exitType(int declarationEnd) - Specified by:
exitTypein interfaceISourceElementRequestor- See Also:
-
resolveDuplicates
Resolves duplicate handles by incrementing the occurrence count of the handle being created. -
getMemberValuePair
-
getMemberValuePairs
-
getMemberValue
-