public class ClassUsageEvent extends UsageEvent
ClassUsageEvent
describes the information about
a class usage that is reported through the ClassUsageListener.
It contains the URL, the start/end offsets of the usage, and a
usage code describing the location the usage occurred, such
as in an import statement (USAGE_IMPORT).Modifier and Type | Field and Description |
---|---|
static int |
USAGE_CLASS_DECLARATION
Constant indicating that the usage is in the class name/decl.
|
static int |
USAGE_CLASS_EXTENDS
Constant indicating that the usage is in the class extends.
|
static int |
USAGE_CLASS_IMPLEMENTS
Constant indicating that the usage is in the class implements.
|
static int |
USAGE_FIELD_TYPE
Constant indicating that the usage is in the field decl type.
|
static int |
USAGE_IMPORT
Constant indicating that the usage is in import statement.
|
static int |
USAGE_INSTANCEOF
Constant indicating that the usage is in an instanceof clause.
|
static int |
USAGE_METHOD_PARAMETER_TYPE
Constant indicating that the usage is in the method return type.
|
static int |
USAGE_METHOD_RETURN_TYPE
Constant indicating that the usage is in the method return type.
|
static int |
USAGE_METHOD_THROWS
Constant indicating that the usage is in the method throws decl.
|
static int |
USAGE_NEW
Constant indicating that the usage is in a new clause.
|
static int |
USAGE_STATIC_TYPE
Constant indicating that the usage is in a type reference, such as
static method/field access.
|
static int |
USAGE_TYPECAST
Constant indicating that the usage is in a typecast.
|
static int |
USAGE_VARIABLE_TYPE
Constant indicating that the usage is in the variable decl type.
|
_endOffset, _source, _startOffset, _url, _usageCode, USAGE_CANCELLED, USAGE_FAILED, USAGE_FINISHED, USAGE_KEYWORD_SKIPPED, USAGE_URL_SKIPPED
Constructor and Description |
---|
ClassUsageEvent(UsageQueryTask source,
int usageCode,
java.net.URL url,
int startOffset,
int endOffset)
Construct a new usage event.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
usageCodeToString(int code)
Return a human-readable version of the usage code.
|
getEndOffset, getSource, getStartOffset, getURL, getUsageCode, toString
public static final int USAGE_IMPORT
public static final int USAGE_CLASS_DECLARATION
public static final int USAGE_CLASS_EXTENDS
public static final int USAGE_CLASS_IMPLEMENTS
public static final int USAGE_METHOD_RETURN_TYPE
public static final int USAGE_METHOD_PARAMETER_TYPE
public static final int USAGE_METHOD_THROWS
public static final int USAGE_FIELD_TYPE
public static final int USAGE_VARIABLE_TYPE
public static final int USAGE_STATIC_TYPE
public static final int USAGE_TYPECAST
public static final int USAGE_NEW
public static final int USAGE_INSTANCEOF
public ClassUsageEvent(UsageQueryTask source, int usageCode, java.net.URL url, int startOffset, int endOffset)
source
- the query taskusageCode
- the usage code describing this eventurl
- the URL where the event occurredstartOffset
- the starting offsetendOffset
- the ending offsetprotected java.lang.String usageCodeToString(int code)
usageCodeToString
in class UsageEvent
code
- the usage code