Package org.eclipse.jdt.core.dom.rewrite
Enum ImportRewrite.TypeLocation
- java.lang.Object
-
- java.lang.Enum<ImportRewrite.TypeLocation>
-
- org.eclipse.jdt.core.dom.rewrite.ImportRewrite.TypeLocation
-
- All Implemented Interfaces:
Serializable,Comparable<ImportRewrite.TypeLocation>
- Enclosing class:
- ImportRewrite
public static enum ImportRewrite.TypeLocation extends Enum<ImportRewrite.TypeLocation>
Used to determine how a type will be used, so that unwanted annotations can be filtered, which is in particular relevant for avoiding redundant null annotations in the scope of@NonNullByDefault. This enum is a superset of org.eclipse.jdt.annotation.DefaultLocation, and roughly corresponds to the classification of type locations as introduced by JSR 308.- Since:
- 3.13
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ARRAY_CONTENTSsee org.eclipse.jdt.annotation.DefaultLocation.ARRAY_CONTENTSCASTThe special valueCASTis used for casts.EXCEPTIONThe special valueEXCEPTIONis used for exception types in catch and throws declarations, which are implicitly non-null.FIELDsee org.eclipse.jdt.annotation.DefaultLocation.FIELDINSTANCEOFThe special valueINSTANCEOFis used forinstanceofexpressions.LOCAL_VARIABLEThe special valueLOCAL_VARIABLEis used for local variables: their nullness is determines by flow analysis, so top level nullness annotations are usually not needed for local variables (unless their type is a free type variable).NEWThe special valueNEWis used fornewexpressions (object allocations).OTHERThe special valueOTHERis used for locations where type annotations are illegal, like type literals (X.class), annotations, or as scope for static field accesses.PARAMETERsee org.eclipse.jdt.annotation.DefaultLocation.PARAMETERRECEIVERThe special valueRECEIVERis used for the receiver type in a method declaration or method reference.RETURN_TYPEsee org.eclipse.jdt.annotation.DefaultLocation.RETURN_TYPETYPE_ARGUMENTsee org.eclipse.jdt.annotation.DefaultLocation.TYPE_ARGUMENTTYPE_BOUNDsee org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUNDTYPE_PARAMETERsee org.eclipse.jdt.annotation.DefaultLocation.TYPE_PARAMETERUNKNOWNThe special valueUNKNOWNis used for invocations that don't specify the intended type usage.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ImportRewrite.TypeLocationvalueOf(String name)Returns the enum constant of this type with the specified name.static ImportRewrite.TypeLocation[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PARAMETER
public static final ImportRewrite.TypeLocation PARAMETER
see org.eclipse.jdt.annotation.DefaultLocation.PARAMETER- Since:
- 3.13
-
RETURN_TYPE
public static final ImportRewrite.TypeLocation RETURN_TYPE
see org.eclipse.jdt.annotation.DefaultLocation.RETURN_TYPE- Since:
- 3.13
-
FIELD
public static final ImportRewrite.TypeLocation FIELD
see org.eclipse.jdt.annotation.DefaultLocation.FIELD- Since:
- 3.13
-
TYPE_PARAMETER
public static final ImportRewrite.TypeLocation TYPE_PARAMETER
see org.eclipse.jdt.annotation.DefaultLocation.TYPE_PARAMETER- Since:
- 3.13
-
TYPE_BOUND
public static final ImportRewrite.TypeLocation TYPE_BOUND
see org.eclipse.jdt.annotation.DefaultLocation.TYPE_BOUND- Since:
- 3.13
-
TYPE_ARGUMENT
public static final ImportRewrite.TypeLocation TYPE_ARGUMENT
see org.eclipse.jdt.annotation.DefaultLocation.TYPE_ARGUMENT- Since:
- 3.13
-
ARRAY_CONTENTS
public static final ImportRewrite.TypeLocation ARRAY_CONTENTS
see org.eclipse.jdt.annotation.DefaultLocation.ARRAY_CONTENTS- Since:
- 3.13
-
LOCAL_VARIABLE
public static final ImportRewrite.TypeLocation LOCAL_VARIABLE
The special valueLOCAL_VARIABLEis used for local variables: their nullness is determines by flow analysis, so top level nullness annotations are usually not needed for local variables (unless their type is a free type variable). Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
CAST
public static final ImportRewrite.TypeLocation CAST
The special valueCASTis used for casts. Casts are never affected by@NonNullByDefaultDoes not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
INSTANCEOF
public static final ImportRewrite.TypeLocation INSTANCEOF
The special valueINSTANCEOFis used forinstanceofexpressions. Null annotations are not supported in this location. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
NEW
public static final ImportRewrite.TypeLocation NEW
The special valueNEWis used fornewexpressions (object allocations). Null annotations are not supported in this location. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
RECEIVER
public static final ImportRewrite.TypeLocation RECEIVER
The special valueRECEIVERis used for the receiver type in a method declaration or method reference. Null annotations are not supported in this location. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
EXCEPTION
public static final ImportRewrite.TypeLocation EXCEPTION
The special valueEXCEPTIONis used for exception types in catch and throws declarations, which are implicitly non-null. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
OTHER
public static final ImportRewrite.TypeLocation OTHER
The special valueOTHERis used for locations where type annotations are illegal, like type literals (X.class), annotations, or as scope for static field accesses. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
UNKNOWN
public static final ImportRewrite.TypeLocation UNKNOWN
The special valueUNKNOWNis used for invocations that don't specify the intended type usage. Does not correspond to a value in org.eclipse.jdt.annotation.DefaultLocation.- Since:
- 3.13
-
-
Method Detail
-
values
public static ImportRewrite.TypeLocation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ImportRewrite.TypeLocation c : ImportRewrite.TypeLocation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ImportRewrite.TypeLocation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-