Klasse CompletionContext

java.lang.Object
org.aspectj.org.eclipse.jdt.core.CompletionContext
Bekannte direkte Unterklassen:
InternalCompletionContext

public class CompletionContext extends Object
Completion context. Represent the context in which the completion occurs.
Seit:
3.1
Siehe auch:
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final int
    The completed token is the first token of a constructor invocation expression.
    e.g.
    static final int
    The completed token is part of an import statement
    e.g.
    static final int
    The completed token is the first token of a member declaration.
    e.g.
    static final int
    The completed token is the first token of a statement.
    e.g.
    static final int
    The completion token is a name.
    static final int
    The completion token is a string literal.
    static final int
    The completion token is unknown.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    Returns the innermost enclosing Java element which contains the completion location or null if this element cannot be computed.
    char[][]
    Return keys of expected types of a potential completion proposal at the completion position.
    char[][]
    Return signatures of expected types of a potential completion proposal at the completion position.
    int
    Returns the offset position in the source file buffer after which code assist is requested.
    char[]
    Returns the completed token.
    int
    Returns the character index of the end (exclusive) of the subrange in the source file buffer containing the relevant token.
    int
    Returns the kind of completion token being proposed.
    int
    Returns the location of completion token being proposed.
    int
    Returns the character index of the start of the subrange in the source file buffer containing the relevant token being completed.
    getVisibleElements(String typeSignature)
    Return the elements which are visible from the completion location and which can be assigned to the given type.
    boolean
    Returns whether this completion context is an extended context.
    boolean
    Tell user whether completion takes place in a javadoc comment or not.
    boolean
    Tell user whether completion takes place in a formal reference of a javadoc tag or not.
    boolean
    Tell user whether completion takes place in text area of a javadoc comment or not.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • TL_MEMBER_START

      public static final int TL_MEMBER_START
      The completed token is the first token of a member declaration.
      e.g.
       public class X {
         Foo| // completion occurs at |
       }
       
      Seit:
      3.4
      Siehe auch:
    • TL_STATEMENT_START

      public static final int TL_STATEMENT_START
      The completed token is the first token of a statement.
      e.g.
       public class X {
         public void bar() {
           Foo| // completion occurs at |
         }
       }
       
      Seit:
      3.4
      Siehe auch:
    • TL_CONSTRUCTOR_START

      public static final int TL_CONSTRUCTOR_START
      The completed token is the first token of a constructor invocation expression.
      e.g.
       public class X {
         public void bar() {
           new Foo| // completion occurs at |
         }
       }
       
      Seit:
      3.9
      Siehe auch:
    • TL_IN_IMPORT

      public static final int TL_IN_IMPORT
      The completed token is part of an import statement
      e.g.
       import java.util| // completion occurs at |
       
      Seit:
      3.21
      Siehe auch:
    • TOKEN_KIND_UNKNOWN

      public static final int TOKEN_KIND_UNKNOWN
      The completion token is unknown.
      Seit:
      3.2
      Siehe auch:
    • TOKEN_KIND_NAME

      public static final int TOKEN_KIND_NAME
      The completion token is a name.
      Seit:
      3.2
      Siehe auch:
    • TOKEN_KIND_STRING_LITERAL

      public static final int TOKEN_KIND_STRING_LITERAL
      The completion token is a string literal. The string literal ends quote can be not present the source. "foo" or "foo.
      Seit:
      3.2
      Siehe auch:
  • Konstruktordetails

    • CompletionContext

      public CompletionContext()
  • Methodendetails

    • isInJavadoc

      public boolean isInJavadoc()
      Tell user whether completion takes place in a javadoc comment or not.
      Gibt zurück:
      boolean true if completion takes place in a javadoc comment, false otherwise.
      Seit:
      3.2
    • isInJavadocText

      public boolean isInJavadocText()
      Tell user whether completion takes place in text area of a javadoc comment or not.
      Gibt zurück:
      boolean true if completion takes place in a text area of a javadoc comment, false otherwise.
      Seit:
      3.2
    • isInJavadocFormalReference

      public boolean isInJavadocFormalReference()
      Tell user whether completion takes place in a formal reference of a javadoc tag or not. Tags with formal reference are:
      • @see
      • @throws
      • @exception
      • {@link Object}
      • {@linkplain Object}
      • {@value} when compiler compliance is set at leats to 1.5
      Gibt zurück:
      boolean true if completion takes place in formal reference of a javadoc tag, false otherwise.
      Seit:
      3.2
    • isExtended

      public boolean isExtended()
      Returns whether this completion context is an extended context. Some methods of this context can be used only if this context is an extended context but an extended context consumes more memory.
      Gibt zurück:
      true if this completion context is an extended context.
      Seit:
      3.4
    • getExpectedTypesSignatures

      public char[][] getExpectedTypesSignatures()
      Return signatures of expected types of a potential completion proposal at the completion position. It's not mandatory to a completion proposal to respect this expectation.
      Gibt zurück:
      signatures expected types of a potential completion proposal at the completion position or null if there is no expected types.
      Siehe auch:
    • getExpectedTypesKeys

      public char[][] getExpectedTypesKeys()
      Return keys of expected types of a potential completion proposal at the completion position. It's not mandatory to a completion proposal to respect this expectation.
      Gibt zurück:
      keys of expected types of a potential completion proposal at the completion position or null if there is no expected types.
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.aspectj.org.eclipse.jdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor)
    • getToken

      public char[] getToken()
      Returns the completed token. This token is either the identifier or Java language keyword or the string literal under, immediately preceding, the original request offset. If the original request offset is not within or immediately after an identifier or keyword or a string literal then the returned value is null.
      Gibt zurück:
      completed token or null
      Seit:
      3.2
    • getTokenKind

      public int getTokenKind()
      Returns the kind of completion token being proposed.

      The 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.

      Gibt zurück:
      the kind; one of the kind constants declared on this class whose name starts with TOKEN_KIND, or possibly a kind unknown to the caller
      Seit:
      3.2
    • getTokenLocation

      public int getTokenLocation()
      Returns the location of completion token being proposed. The returned location is a bit mask which can contain some values of the constants declared on this class whose name starts with TL, 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.

      Gibt zurück:
      the location
      Seit:
      3.4
    • getTokenStart

      public int getTokenStart()
      Returns the character index of the start of the subrange in the source file buffer containing the relevant token being completed. This token is either the identifier or Java language keyword under, or immediately preceding, the original request offset. If the original request offset is not within or immediately after an identifier or keyword, then the position returned is original request offset and the token range is empty.
      Gibt zurück:
      character index of token start position (inclusive)
      Seit:
      3.2
    • getTokenEnd

      public int getTokenEnd()
      Returns the character index of the end (exclusive) of the subrange in the source file buffer containing the relevant token. When there is no relevant token, the range is empty (getTokenEnd() == getTokenStart() - 1).
      Gibt zurück:
      character index of token end position (exclusive)
      Seit:
      3.2
    • getOffset

      public int getOffset()
      Returns the offset position in the source file buffer after which code assist is requested.
      Gibt zurück:
      offset position in the source file buffer
      Seit:
      3.2
    • getEnclosingElement

      public IJavaElement getEnclosingElement()
      Returns the innermost enclosing Java element which contains the completion location or null 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:
      • they are based on the current content of the compilation unit's buffer, they are not the result of a reconcile operation
      • they are not updated if the buffer changes.
      • they do not contain local types which are not visible from the completion location.
      • they do not give information about categories. IMember.getCategories() will return an empty array
      Reasons for returning null include:
      • the compilation unit no longer exists
      • the completion occurred in a binary type. However this restriction might be relaxed in the future.
      Gibt zurück:
      the innermost enclosing Java element which contains the completion location or null if this element cannot be computed.
      Löst aus:
      UnsupportedOperationException - if the context is not an extended context
      Seit:
      3.4
    • getVisibleElements

      public IJavaElement[] getVisibleElements(String typeSignature)
      Return the elements which are visible from the completion location and which can be assigned to the given type. An element is assignable if its type can be assigned to a variable of the given type, as specified in section 5.2 of The Java Language Specification, Third Edition (JLS3). A visible element is either: Returned elements defined in the completed compilation unit are special Java elements:
      • they are based on the current content of the compilation unit's buffer, they are not the result of a reconcile operation
      • they are not updated if the buffer changes.
      • they do not contain local types which are not visible from the completion location.
      • they do not give information about categories. IMember.getCategories() will return an empty array
      Note the array can be empty if:
      • the compilation unit no longer exists
      • the completion occurred in a binary type. However this restriction might be relaxed in the future.
      Parameter:
      typeSignature - elements which can be assigned to this type are returned. If null there is no constraint on the type of the returned elements.
      Gibt zurück:
      elements which are visible from the completion location and which can be assigned to the given type.
      Löst aus:
      UnsupportedOperationException - if the context is not an extended context
      Seit:
      3.4
      Siehe auch: