public class InternalCompletionContext extends CompletionContext
| Modifier and Type | Field and Description |
|---|---|
protected char[][] |
expectedTypesKeys |
protected char[][] |
expectedTypesSignatures |
protected InternalExtendedCompletionContext |
extendedContext |
protected boolean |
isExtended |
protected int |
javadoc |
protected int |
offset |
protected char[] |
token |
protected int |
tokenEnd |
protected int |
tokenKind |
protected int |
tokenLocation |
protected int |
tokenStart |
TL_CONSTRUCTOR_START, TL_IN_IMPORT, TL_MEMBER_START, TL_STATEMENT_START, TOKEN_KIND_NAME, TOKEN_KIND_STRING_LITERAL, TOKEN_KIND_UNKNOWN| Constructor and Description |
|---|
InternalCompletionContext() |
| Modifier and Type | Method and Description |
|---|---|
ASTNode |
getCompletionNode()
Return the completion node associated with the current completion.
|
ASTNode |
getCompletionNodeParent()
Return the parent AST node of the completion node associated with the current completion.
|
IJavaElement |
getEnclosingElement()
Returns the innermost enclosing Java element which contains the completion location or
null if this element cannot be computed. |
char[][] |
getExpectedTypesKeys()
Return keys of expected types of a potential completion proposal at the completion position.
|
char[][] |
getExpectedTypesSignatures()
Return signatures of expected types of a potential completion proposal at the completion position.
|
int |
getOffset()
Returns the offset position in the source file buffer
after which code assist is requested.
|
char[] |
getToken()
Returns the completed token.
|
int |
getTokenEnd()
Returns the character index of the end (exclusive) of the subrange
in the source file buffer containing the
relevant token.
|
int |
getTokenKind()
Returns the kind of completion token being proposed.
|
int |
getTokenLocation()
Returns the location of completion token being proposed.
|
int |
getTokenStart()
Returns the character index of the start of the
subrange in the source file buffer containing the
relevant token being completed.
|
IJavaElement[] |
getVisibleElements(java.lang.String typeSignature)
Return the elements which are visible from the completion location and which can be assigned to the given type.
|
ObjectVector |
getVisibleFields()
Return the bindings of all visible fields in the current completion context.
|
ObjectVector |
getVisibleLocalVariables()
Return the bindings of all visible local variables in the current completion context.
|
ObjectVector |
getVisibleMethods()
Return the bindings of all visible methods in the current completion context.
|
boolean |
isExtended()
Returns whether this completion context is an extended context.
|
boolean |
isInJavadoc()
Tell user whether completion takes place in a javadoc comment or not.
|
boolean |
isInJavadocFormalReference()
Tell user whether completion takes place in a formal reference of a javadoc tag or not.
|
boolean |
isInJavadocText()
Tell user whether completion takes place in text area of a javadoc comment or not.
|
protected void |
setExpectedTypesKeys(char[][] expectedTypesKeys) |
protected void |
setExpectedTypesSignatures(char[][] expectedTypesSignatures) |
protected void |
setExtended() |
protected void |
setExtendedData(ITypeRoot typeRoot,
CompilationUnitDeclaration compilationUnitDeclaration,
LookupEnvironment lookupEnvironment,
Scope scope,
ASTNode astNode,
ASTNode astNodeParent,
WorkingCopyOwner owner,
CompletionParser parser) |
protected void |
setJavadoc(int javadoc) |
protected void |
setOffset(int offset) |
protected void |
setToken(char[] token) |
protected void |
setTokenKind(int tokenKind) |
protected void |
setTokenLocation(int tokenLocation) |
protected void |
setTokenRange(int start,
int end) |
protected void |
setTokenRange(int start,
int end,
int endOfEmptyToken) |
protected char[][] expectedTypesSignatures
protected char[][] expectedTypesKeys
protected int javadoc
protected int offset
protected int tokenStart
protected int tokenEnd
protected char[] token
protected int tokenKind
protected int tokenLocation
protected boolean isExtended
protected InternalExtendedCompletionContext extendedContext
protected void setExpectedTypesKeys(char[][] expectedTypesKeys)
protected void setExpectedTypesSignatures(char[][] expectedTypesSignatures)
protected void setExtended()
protected void setExtendedData(ITypeRoot typeRoot, CompilationUnitDeclaration compilationUnitDeclaration, LookupEnvironment lookupEnvironment, Scope scope, ASTNode astNode, ASTNode astNodeParent, WorkingCopyOwner owner, CompletionParser parser)
protected void setJavadoc(int javadoc)
protected void setOffset(int offset)
protected void setToken(char[] token)
protected void setTokenKind(int tokenKind)
protected void setTokenLocation(int tokenLocation)
protected void setTokenRange(int start,
int end)
protected void setTokenRange(int start,
int end,
int endOfEmptyToken)
public IJavaElement getEnclosingElement()
CompletionContextnull if this element cannot be computed.
The returned Java element and all Java elements in the same compilation unit which can be navigated to from the returned Java element are special Java elements:
IMember.getCategories() will return an empty arraynull include:
getEnclosingElement in class CompletionContextnull if this element cannot be computed.public char[][] getExpectedTypesKeys()
CompletionContextgetExpectedTypesKeys in class CompletionContextnull if there is no expected types.org.aspectj.org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.aspectj.org.eclipse.jdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor)public char[][] getExpectedTypesSignatures()
CompletionContextgetExpectedTypesSignatures in class CompletionContextnull if there is no expected types.Signaturepublic int getOffset()
CompletionContextgetOffset in class CompletionContextpublic char[] getToken()
CompletionContextnull.getToken in class CompletionContextnullpublic int getTokenEnd()
CompletionContextgetTokenEnd() == getTokenStart() - 1).getTokenEnd in class CompletionContextpublic int getTokenKind()
CompletionContextThe set of different kinds of completion token is expected to change over time. It is strongly recommended that clients do not assume that the kind is one of the ones they know about, and code defensively for the possibility of unexpected future growth.
getTokenKind in class CompletionContextTOKEN_KIND,
or possibly a kind unknown to the callerpublic int getTokenLocation()
CompletionContextTL,
or possibly values unknown to the caller.
The set of different location values is expected to change over time. It is strongly recommended that clients do not assume that the location contains only known value, and code defensively for the possibility of unexpected future growth.
getTokenLocation in class CompletionContextpublic int getTokenStart()
CompletionContextgetTokenStart in class CompletionContextpublic IJavaElement[] getVisibleElements(java.lang.String typeSignature)
CompletionContextILocalVariable - the element type is ILocalVariable.getTypeSignature()IField - the element type is IField.getTypeSignature()IMethod - the element type is IMethod.getReturnType()IMember.getCategories() will return an empty arraygetVisibleElements in class CompletionContexttypeSignature - elements which can be assigned to this type are returned.
If null there is no constraint on the type of the returned elements.CompletionContext.isExtended()public boolean isExtended()
CompletionContextisExtended in class CompletionContexttrue if this completion context is an extended context.public boolean isInJavadoc()
CompletionContextisInJavadoc in class CompletionContextpublic boolean isInJavadocFormalReference()
CompletionContextisInJavadocFormalReference in class CompletionContextpublic boolean isInJavadocText()
CompletionContextisInJavadocText in class CompletionContextpublic ASTNode getCompletionNode()
java.lang.UnsupportedOperationException - if the context is not an extended contextisExtended()public ASTNode getCompletionNodeParent()
java.lang.UnsupportedOperationException - if the context is not an extended contextisExtended()public ObjectVector getVisibleLocalVariables()
LocalVariableBindingjava.lang.UnsupportedOperationException - if the context is not an extended contextisExtended()public ObjectVector getVisibleFields()
FieldBindingjava.lang.UnsupportedOperationException - if the context is not an extended contextisExtended()public ObjectVector getVisibleMethods()
MethodBindingjava.lang.UnsupportedOperationException - if the context is not an extended contextisExtended()