org.eclipse.wst.jsdt.core.dom.rewrite
Class ImportRewrite.ImportRewriteContext

java.lang.Object
  extended by org.eclipse.wst.jsdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext
Enclosing class:
ImportRewrite

public abstract static class ImportRewrite.ImportRewriteContext
extends java.lang.Object

A ImportRewrite.ImportRewriteContext can optionally be used in e.g. ImportRewrite#addImport(String, ImportRewrite.ImportRewriteContext) to give more information about the types visible in the scope. These types can be for example inherited inner types where it is unnecessary to add import statements for.

This class can be implemented by clients.


Field Summary
static int KIND_STATIC_FIELD
          Kind constant specifying that the element is a static field import.
static int KIND_STATIC_METHOD
          Kind constant specifying that the element is a static method import.
static int KIND_TYPE
          Kind constant specifying that the element is a type import.
static int RES_NAME_CONFLICT
          Result constant signaling that the given element is conflicting with an other element in the context.
static int RES_NAME_FOUND
          Result constant signaling that the given element is know in the context.
static int RES_NAME_UNKNOWN
          Result constant signaling that the given element is not know in the context.
 
Constructor Summary
ImportRewrite.ImportRewriteContext()
           
 
Method Summary
abstract  int findInContext(java.lang.String qualifier, java.lang.String name, int kind)
          Searches for the given element in the context and reports if the element is known (RES_NAME_FOUND), unknown (RES_NAME_UNKNOWN) or if its name conflicts (RES_NAME_CONFLICT) with an other element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RES_NAME_FOUND

public static final int RES_NAME_FOUND
Result constant signaling that the given element is know in the context.

See Also:
Constant Field Values

RES_NAME_UNKNOWN

public static final int RES_NAME_UNKNOWN
Result constant signaling that the given element is not know in the context.

See Also:
Constant Field Values

RES_NAME_CONFLICT

public static final int RES_NAME_CONFLICT
Result constant signaling that the given element is conflicting with an other element in the context.

See Also:
Constant Field Values

KIND_TYPE

public static final int KIND_TYPE
Kind constant specifying that the element is a type import.

See Also:
Constant Field Values

KIND_STATIC_FIELD

public static final int KIND_STATIC_FIELD
Kind constant specifying that the element is a static field import.

See Also:
Constant Field Values

KIND_STATIC_METHOD

public static final int KIND_STATIC_METHOD
Kind constant specifying that the element is a static method import.

See Also:
Constant Field Values
Constructor Detail

ImportRewrite.ImportRewriteContext

public ImportRewrite.ImportRewriteContext()
Method Detail

findInContext

public abstract int findInContext(java.lang.String qualifier,
                                  java.lang.String name,
                                  int kind)
Searches for the given element in the context and reports if the element is known (RES_NAME_FOUND), unknown (RES_NAME_UNKNOWN) or if its name conflicts (RES_NAME_CONFLICT) with an other element.

Parameters:
qualifier - The qualifier of the element, can be package or the qualified name of a type
name - The simple name of the element; either a type, method or field name or * for on-demand imports.
kind - The kind of the element. Can be either KIND_TYPE, KIND_STATIC_FIELD or KIND_STATIC_METHOD. Implementors should be prepared for new, currently unspecified kinds and return RES_NAME_UNKNOWN by default.
Returns:
Returns the result of the lookup. Can be either RES_NAME_FOUND, RES_NAME_UNKNOWN or RES_NAME_CONFLICT.