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

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.SelectionRequestor
All Implemented Interfaces:
ISelectionRequestor

public class SelectionRequestor
extends java.lang.Object
implements ISelectionRequestor

Implementation of ISelectionRequestor to assist with code resolve in a compilation unit. Translates names to elements.


Field Summary
protected  int elementIndex
           
protected  IJavaElement[] elements
           
protected  HandleFactory handleFactory
           
protected  NameLookup nameLookup
           
protected  Openable openable
           
 
Constructor Summary
SelectionRequestor(NameLookup nameLookup, Openable openable)
          Creates a selection requestor that uses that given name lookup facility to resolve names.
 
Method Summary
protected  void acceptBinaryMethod(IType type, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, java.lang.String[] parameterSignatures, char[][] typeParameterNames, char[][][] typeParameterBoundNames, char[] uniqueKey, boolean isConstructor)
          Resolve the binary method fix for 1FWFT6Q
 void acceptError(CategorizedProblem error)
          Code assist notification of a compilation error detected during selection.
 void acceptField(char[] declaringTypePackageName, char[] declaringTypeName, char[] name, boolean isDeclaration, char[] uniqueKey, int start, int end)
          Resolve the field.
 void acceptLocalField(FieldBinding fieldBinding)
           
 void acceptLocalMethod(MethodBinding methodBinding)
           
 void acceptLocalMethodTypeParameter(TypeVariableBinding typeVariableBinding)
           
 void acceptLocalType(TypeBinding typeBinding)
           
 void acceptLocalTypeParameter(TypeVariableBinding typeVariableBinding)
           
 void acceptLocalVariable(LocalVariableBinding binding)
           
 void acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, java.lang.String enclosingDeclaringTypeSignature, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, java.lang.String[] parameterSignatures, char[][] typeParameterNames, char[][][] typeParameterBoundNames, boolean isConstructor, boolean isDeclaration, char[] uniqueKey, int start, int end)
          Resolve the method
protected  void acceptMethodDeclaration(IType type, char[] selector, int start, int end)
           
 void acceptMethodTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, int selectorStart, int selectorEnd, char[] typeParameterName, boolean isDeclaration, int start, int end)
          Code assist notification of a type parameter selection.
 void acceptPackage(char[] packageName)
          Resolve the package
protected  void acceptSourceMethod(IType type, char[] selector, char[][] parameterPackageNames, char[][] parameterTypeNames, java.lang.String[] parameterSignatures, char[][] typeParameterNames, char[][][] typeParameterBoundNames, char[] uniqueKey)
          Resolve the source method fix for 1FWFT6Q
 void acceptType(char[] packageName, char[] typeName, int modifiers, boolean isDeclaration, char[] uniqueKey, int start, int end)
          Resolve the type.
 void acceptType(IType type)
          Resolve the type.
 void acceptTypeParameter(char[] declaringTypePackageName, char[] declaringTypeName, char[] typeParameterName, boolean isDeclaration, int start, int end)
          Code assist notification of a type parameter selection.
protected  void addElement(IJavaElement element)
           
protected  IJavaElement findLocalElement(int pos)
           
 IJavaElement findMethodFromBinding(MethodBinding method, java.lang.String[] signatures, ReferenceBinding declaringClass)
          This method returns an IMethod element from the given method and declaring type bindings.
 IJavaElement[] getElements()
          Returns the resolved elements.
protected  IType resolveType(char[] packageName, char[] typeName, int acceptFlags)
          Resolve the type
protected  IType resolveTypeByLocation(char[] packageName, char[] typeName, int acceptFlags, int start, int end)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameLookup

protected NameLookup nameLookup

openable

protected Openable openable

elements

protected IJavaElement[] elements

elementIndex

protected int elementIndex

handleFactory

protected HandleFactory handleFactory
Constructor Detail

SelectionRequestor

public SelectionRequestor(NameLookup nameLookup,
                          Openable openable)
Creates a selection requestor that uses that given name lookup facility to resolve names. Fix for 1FVXGDK

Method Detail

acceptBinaryMethod

protected void acceptBinaryMethod(IType type,
                                  char[] selector,
                                  char[][] parameterPackageNames,
                                  char[][] parameterTypeNames,
                                  java.lang.String[] parameterSignatures,
                                  char[][] typeParameterNames,
                                  char[][][] typeParameterBoundNames,
                                  char[] uniqueKey,
                                  boolean isConstructor)
Resolve the binary method fix for 1FWFT6Q


acceptType

public void acceptType(char[] packageName,
                       char[] typeName,
                       int modifiers,
                       boolean isDeclaration,
                       char[] uniqueKey,
                       int start,
                       int end)
Resolve the type.

Specified by:
acceptType in interface ISelectionRequestor
Parameters:
packageName - char[] Declaring package name of the type.
typeName - char[] Name of the type.
isDeclaration - boolean Answer if the selected type is a declaration
uniqueKey - genric type signature of the selected type if it is a parameterized type
start - Start of the selection
end - End of the selection NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Nested type names are in the qualified form "A.M". The default package is represented by an empty array.

acceptType

public void acceptType(IType type)
Resolve the type.


acceptError

public void acceptError(CategorizedProblem error)
Description copied from interface: ISelectionRequestor
Code assist notification of a compilation error detected during selection.

Specified by:
acceptError in interface ISelectionRequestor
Parameters:
error - CategorizedProblem Only problems which are categorized as errors are notified to the requestor, warnings are silently ignored. In case an error got signaled, no other completions might be available, therefore the problem message should be presented to the user. The source positions of the problem are related to the source where it was detected (might be in another compilation unit, if it was indirectly requested during the code assist process). Note: the problem knows its originating file name.
See Also:
ISelectionRequestor.acceptError(org.aspectj.org.eclipse.jdt.core.compiler.CategorizedProblem)

acceptField

public void acceptField(char[] declaringTypePackageName,
                        char[] declaringTypeName,
                        char[] name,
                        boolean isDeclaration,
                        char[] uniqueKey,
                        int start,
                        int end)
Resolve the field.

Specified by:
acceptField in interface ISelectionRequestor
Parameters:
declaringTypePackageName - char[] Name of the package in which the type that contains this field is declared.
declaringTypeName - char[] Name of the type declaring this new field.
name - char[] Name of the field.
isDeclaration - boolean Answer if the selected field is a declaration
uniqueKey - unique key of this field
start - Start of the selection
end - End of the selection NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Nested type names are in the qualified form "A.M". The default package is represented by an empty array.

acceptLocalField

public void acceptLocalField(FieldBinding fieldBinding)

acceptLocalMethod

public void acceptLocalMethod(MethodBinding methodBinding)

acceptLocalType

public void acceptLocalType(TypeBinding typeBinding)

acceptLocalTypeParameter

public void acceptLocalTypeParameter(TypeVariableBinding typeVariableBinding)

acceptLocalMethodTypeParameter

public void acceptLocalMethodTypeParameter(TypeVariableBinding typeVariableBinding)

acceptLocalVariable

public void acceptLocalVariable(LocalVariableBinding binding)

acceptMethod

public void acceptMethod(char[] declaringTypePackageName,
                         char[] declaringTypeName,
                         java.lang.String enclosingDeclaringTypeSignature,
                         char[] selector,
                         char[][] parameterPackageNames,
                         char[][] parameterTypeNames,
                         java.lang.String[] parameterSignatures,
                         char[][] typeParameterNames,
                         char[][][] typeParameterBoundNames,
                         boolean isConstructor,
                         boolean isDeclaration,
                         char[] uniqueKey,
                         int start,
                         int end)
Resolve the method

Specified by:
acceptMethod in interface ISelectionRequestor
Parameters:
declaringTypePackageName - char[] Name of the package in which the type that contains this new method is declared.
declaringTypeName - char[] Name of the type declaring this new method.
enclosingDeclaringTypeSignature - String Type signature of the declaring type of the declaring type or null if declaring type is a top level type.
selector - char[] Name of the new method.
parameterPackageNames - char[][] Names of the packages in which the parameter types are declared. Should contain as many elements as parameterTypeNames.
parameterTypeNames - char[][] Names of the parameters types. Should contain as many elements as parameterPackageNames.
parameterSignatures - String[] Signature of the parameters types. Should contain as many elements as parameterPackageNames.
isConstructor - boolean Answer if the method is a constructor.
isDeclaration - boolean Answer if the selected method is a declaration
uniqueKey - unique key of the method
start - Start of the selection
end - End of the selection NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Base types are in the form "int" or "boolean". Array types are in the qualified form "M[]" or "int[]". Nested type names are in the qualified form "A.M". The default package is represented by an empty array.

acceptPackage

public void acceptPackage(char[] packageName)
Resolve the package

Specified by:
acceptPackage in interface ISelectionRequestor
Parameters:
packageName - char[] The package name. NOTE - All package names are presented in their readable form: Package names are in the form "a.b.c". The default package is represented by an empty array.

acceptSourceMethod

protected void acceptSourceMethod(IType type,
                                  char[] selector,
                                  char[][] parameterPackageNames,
                                  char[][] parameterTypeNames,
                                  java.lang.String[] parameterSignatures,
                                  char[][] typeParameterNames,
                                  char[][][] typeParameterBoundNames,
                                  char[] uniqueKey)
Resolve the source method fix for 1FWFT6Q


acceptMethodDeclaration

protected void acceptMethodDeclaration(IType type,
                                       char[] selector,
                                       int start,
                                       int end)

acceptTypeParameter

public void acceptTypeParameter(char[] declaringTypePackageName,
                                char[] declaringTypeName,
                                char[] typeParameterName,
                                boolean isDeclaration,
                                int start,
                                int end)
Description copied from interface: ISelectionRequestor
Code assist notification of a type parameter selection.

Specified by:
acceptTypeParameter in interface ISelectionRequestor
Parameters:
declaringTypePackageName - char[] Name of the package in which the type that contains this new method is declared.
declaringTypeName - char[] Name of the type declaring this new method.
typeParameterName - char[] Name of the type parameter.
isDeclaration - boolean Answer if the selected type parameter is a declaration
start - Start of the selection
end - End of the selection NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Nested type names are in the qualified form "A.M". The default package is represented by an empty array.

acceptMethodTypeParameter

public void acceptMethodTypeParameter(char[] declaringTypePackageName,
                                      char[] declaringTypeName,
                                      char[] selector,
                                      int selectorStart,
                                      int selectorEnd,
                                      char[] typeParameterName,
                                      boolean isDeclaration,
                                      int start,
                                      int end)
Description copied from interface: ISelectionRequestor
Code assist notification of a type parameter selection.

Specified by:
acceptMethodTypeParameter in interface ISelectionRequestor
Parameters:
declaringTypePackageName - char[] Name of the package in which the type that contains this new method is declared.
declaringTypeName - char[] Name of the type declaring this new method.
selector - char[] Name of the declaring method.
selectorStart - int Start of the selector.
selectorEnd - int End of the selector.
typeParameterName - char[] Name of the type parameter.
isDeclaration - boolean Answer if the selected type parameter is a declaration
start - Start of the selection
end - End of the selection NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Nested type names are in the qualified form "A.M". The default package is represented by an empty array.

addElement

protected void addElement(IJavaElement element)

findLocalElement

protected IJavaElement findLocalElement(int pos)

findMethodFromBinding

public IJavaElement findMethodFromBinding(MethodBinding method,
                                          java.lang.String[] signatures,
                                          ReferenceBinding declaringClass)
This method returns an IMethod element from the given method and declaring type bindings. However, unlike Util.findMethod(IType, char[], String[], boolean) , this does not require an IType to get the IMethod element.

Parameters:
method - the given method binding
signatures - the type signatures of the method arguments
declaringClass - the binding of the method's declaring class
Returns:
an IMethod corresponding to the method binding given, or null if none is found.

getElements

public IJavaElement[] getElements()
Returns the resolved elements.


resolveType

protected IType resolveType(char[] packageName,
                            char[] typeName,
                            int acceptFlags)
Resolve the type


resolveTypeByLocation

protected IType resolveTypeByLocation(char[] packageName,
                                      char[] typeName,
                                      int acceptFlags,
                                      int start,
                                      int end)