APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.javac.code

public final Enum TargetType

extends Enum<TargetType>
Class Inheritance
Imports
com.sun.tools.javac.util.Assert

Describes the type of program element an extended annotation (or extended compound attribute) targets. By comparison, a Tree.Kind has enum values for all elements in the AST, and it does not provide enough resolution for type arguments (i.e., whether an annotation targets a type argument in a local variable, method return type, or a typecast).

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Field Summary

Modifier and TypeField and Description
public static final TargetType
CAST

For annotations on a typecast.

public static final TargetType
CLASS_EXTENDS

For annotations on the type of an "extends" or "implements" clause.

public static final TargetType
CLASS_TYPE_PARAMETER

For annotations on a class type parameter declaration.

public static final TargetType
CLASS_TYPE_PARAMETER_BOUND

For annotations on a bound of a type parameter of a class.

public static final TargetType
CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT

For annotations on a type argument of an object creation expression.

public static final TargetType
CONSTRUCTOR_REFERENCE

For annotations on a constructor reference receiver.

public static final TargetType
CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT

For annotations on a type argument of a constructor reference.

public static final TargetType
EXCEPTION_PARAMETER

For annotations on an exception parameter.

public static final TargetType
FIELD

For annotations on a field.

public static final TargetType
INSTANCEOF

For annotations on a type test.

private final boolean
public static final TargetType
LOCAL_VARIABLE

For annotations on a local variable.

private static final int
public static final TargetType
METHOD_FORMAL_PARAMETER

For annotations on a method parameter.

public static final TargetType
METHOD_INVOCATION_TYPE_ARGUMENT

For annotations on a type argument of a method call.

public static final TargetType
METHOD_RECEIVER

For annotations on the method receiver.

public static final TargetType
METHOD_REFERENCE

For annotations on a method reference receiver.

public static final TargetType
METHOD_REFERENCE_TYPE_ARGUMENT

For annotations on a type argument of a method reference.

public static final TargetType
METHOD_RETURN

For annotations on a method return type.

public static final TargetType
METHOD_TYPE_PARAMETER

For annotations on a method type parameter declaration.

public static final TargetType
METHOD_TYPE_PARAMETER_BOUND

For annotations on a bound of a type parameter of a method.

public static final TargetType
NEW

For annotations on an object creation expression.

public static final TargetType
RESOURCE_VARIABLE

For annotations on a resource variable.

private static final TargetType[]
private final int
public static final TargetType
THROWS

For annotations on a throws clause in a method declaration.

public static final TargetType
UNKNOWN

For annotations with an unknown target.

Constructor Summary

AccessConstructor and Description
private
TargetType(int targetTypeValue)

private
TargetType(int targetTypeValue, boolean isLocal)

Method Summary

Modifier and TypeMethod and Description
public static TargetType
public boolean
isLocal()

Returns whether or not this TargetType represents an annotation whose target is exclusively a tree in a method body Note: wildcard bound targets could target a local tree and a class member declaration signature tree

public static boolean
public int
public static TargetType
public static TargetType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CASTback to summary
public static final TargetType CAST

For annotations on a typecast.

CLASS_EXTENDSback to summary
public static final TargetType CLASS_EXTENDS

For annotations on the type of an "extends" or "implements" clause.

CLASS_TYPE_PARAMETERback to summary
public static final TargetType CLASS_TYPE_PARAMETER

For annotations on a class type parameter declaration.

CLASS_TYPE_PARAMETER_BOUNDback to summary
public static final TargetType CLASS_TYPE_PARAMETER_BOUND

For annotations on a bound of a type parameter of a class.

CONSTRUCTOR_INVOCATION_TYPE_ARGUMENTback to summary
public static final TargetType CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT

For annotations on a type argument of an object creation expression.

CONSTRUCTOR_REFERENCEback to summary
public static final TargetType CONSTRUCTOR_REFERENCE

For annotations on a constructor reference receiver.

CONSTRUCTOR_REFERENCE_TYPE_ARGUMENTback to summary
public static final TargetType CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT

For annotations on a type argument of a constructor reference.

EXCEPTION_PARAMETERback to summary
public static final TargetType EXCEPTION_PARAMETER

For annotations on an exception parameter.

FIELDback to summary
public static final TargetType FIELD

For annotations on a field.

INSTANCEOFback to summary
public static final TargetType INSTANCEOF

For annotations on a type test.

isLocalback to summary
private final boolean isLocal
LOCAL_VARIABLEback to summary
public static final TargetType LOCAL_VARIABLE

For annotations on a local variable.

MAXIMUM_TARGET_TYPE_VALUEback to summary
private static final int MAXIMUM_TARGET_TYPE_VALUE
METHOD_FORMAL_PARAMETERback to summary
public static final TargetType METHOD_FORMAL_PARAMETER

For annotations on a method parameter.

METHOD_INVOCATION_TYPE_ARGUMENTback to summary
public static final TargetType METHOD_INVOCATION_TYPE_ARGUMENT

For annotations on a type argument of a method call.

METHOD_RECEIVERback to summary
public static final TargetType METHOD_RECEIVER

For annotations on the method receiver.

METHOD_REFERENCEback to summary
public static final TargetType METHOD_REFERENCE

For annotations on a method reference receiver.

METHOD_REFERENCE_TYPE_ARGUMENTback to summary
public static final TargetType METHOD_REFERENCE_TYPE_ARGUMENT

For annotations on a type argument of a method reference.

METHOD_RETURNback to summary
public static final TargetType METHOD_RETURN

For annotations on a method return type.

METHOD_TYPE_PARAMETERback to summary
public static final TargetType METHOD_TYPE_PARAMETER

For annotations on a method type parameter declaration.

METHOD_TYPE_PARAMETER_BOUNDback to summary
public static final TargetType METHOD_TYPE_PARAMETER_BOUND

For annotations on a bound of a type parameter of a method.

NEWback to summary
public static final TargetType NEW

For annotations on an object creation expression.

RESOURCE_VARIABLEback to summary
public static final TargetType RESOURCE_VARIABLE

For annotations on a resource variable.

targetsback to summary
private static final TargetType[] targets
targetTypeValueback to summary
private final int targetTypeValue
THROWSback to summary
public static final TargetType THROWS

For annotations on a throws clause in a method declaration.

UNKNOWNback to summary
public static final TargetType UNKNOWN

For annotations with an unknown target.

Constructor Detail

TargetTypeback to summary
private TargetType(int targetTypeValue)
TargetTypeback to summary
private TargetType(int targetTypeValue, boolean isLocal)

Method Detail

fromTargetTypeValueback to summary
public static TargetType fromTargetTypeValue(int tag)
isLocalback to summary
public boolean isLocal()

Returns whether or not this TargetType represents an annotation whose target is exclusively a tree in a method body Note: wildcard bound targets could target a local tree and a class member declaration signature tree

isValidTargetTypeValueback to summary
public static boolean isValidTargetTypeValue(int tag)
targetTypeValueback to summary
public int targetTypeValue()
valueOfback to summary
public static TargetType valueOf(String name)
valuesback to summary
public static TargetType[] values()