public final class TokenTypes extends Object
Implementation detail: This class has been introduced to break the circular dependency between packages.
Modifier and Type | Field and Description |
---|---|
static int |
ABSTRACT
The
abstract keyword. |
static int |
ANNOTATION
An annotation of a package, type, field, parameter or variable.
|
static int |
ANNOTATION_ARRAY_INIT
An annotation array member initialization.
|
static int |
ANNOTATION_DEF
An annotation declaration.
|
static int |
ANNOTATION_FIELD_DEF
An annotation field declaration.
|
static int |
ANNOTATION_MEMBER_VALUE_PAIR
An initialization of an annotation member with a value.
|
static int |
ANNOTATIONS
A collection of annotations on a package or enum constant.
|
static int |
ARRAY_DECLARATOR
An array declaration.
|
static int |
ARRAY_INIT
An array initialization.
|
static int |
ASSIGN
The
= (assignment) operator. |
static int |
AT
An
@ symbol - signifying an annotation instance or the prefix
to the interface literal signifying the definition of an annotation
declaration. |
static int |
BAND
The
& (bitwise AND) operator. |
static int |
BAND_ASSIGN
The
&= (bitwise AND assignment) operator. |
static int |
BLOCK_COMMENT_BEGIN
Beginning of block comment: '/*'.
|
static int |
BLOCK_COMMENT_END
End of block comment: '*/'.
|
static int |
BNOT
The
~ (bitwise complement) operator. |
static int |
BOR
The
| (bitwise OR) operator. |
static int |
BOR_ASSIGN
The
|= (bitwise OR assignment) operator. |
static int |
BSR
The
>>> (unsigned shift right) operator. |
static int |
BSR_ASSIGN
The
>>>= (unsigned right shift assignment)
operator. |
static int |
BXOR
The
^ (bitwise exclusive OR) operator. |
static int |
BXOR_ASSIGN
The
^= (bitwise exclusive OR assignment) operator. |
static int |
CASE_GROUP
A group of case clauses.
|
static int |
CHAR_LITERAL
A character literal.
|
static int |
CLASS_DEF
A class declaration.
|
static int |
COLON
The
: (colon) operator. |
static int |
COMMA
The
, (comma) operator. |
static int |
COMMENT_CONTENT
Text of single-line or block comment.
|
static int |
CTOR_CALL
A constructor call.
|
static int |
CTOR_DEF
A constructor declaration.
|
static int |
DEC
The
-- (prefix decrement) operator. |
static int |
DIV
The
/ (division) operator. |
static int |
DIV_ASSIGN
The
/= (division assignment) operator. |
static int |
DO_WHILE
Literal
while in do-while loop. |
static int |
DOT
The
. (dot) operator. |
static int |
DOUBLE_COLON
The
:: (double colon) separator. |
static int |
ELIST
An expression list.
|
static int |
ELLIPSIS
A triple dot for variable-length parameters.
|
static int |
EMPTY_STAT
The empty statement.
|
static int |
ENUM
The
enum keyword. |
static int |
ENUM_CONSTANT_DEF
An enum constant declaration.
|
static int |
ENUM_DEF
An enum declaration.
|
static int |
EOF
The end of file token.
|
static int |
EQUAL
The
== (equal) operator. |
static int |
EXPR
An expression.
|
static int |
EXTENDS_CLAUSE
An extends clause.
|
static int |
FINAL
The
final keyword. |
static int |
FOR_CONDITION
A for loop condition.
|
static int |
FOR_EACH_CLAUSE
A for-each clause.
|
static int |
FOR_INIT
A for loop initializer.
|
static int |
FOR_ITERATOR
A for loop iterator.
|
static int |
GE
The
>= (greater than or equal) operator. |
static int |
GENERIC_END
A
> symbol signifying the end of type arguments or type parameters. |
static int |
GENERIC_START
A
< symbol signifying the start of type arguments or type parameters. |
static int |
GT
The
> (greater than) operator. |
static int |
IDENT
An identifier.
|
static int |
IMPLEMENTS_CLAUSE
An implements clause.
|
static int |
IMPORT
An import declaration.
|
static int |
INC
The
++ (prefix increment) operator. |
static int |
INDEX_OP
The array index operator.
|
static int |
INSTANCE_INIT
An instance initializer.
|
static int |
INTERFACE_DEF
An interface declaration.
|
static int |
LABELED_STAT
A labeled statement.
|
static int |
LAMBDA
Special lambda symbol
-> . |
static int |
LAND
The
&& (conditional AND) operator. |
static int |
LCURLY
A left curly brace (
{ ). |
static int |
LE
The
<= (less than or equal) operator. |
static int |
LITERAL_ASSERT
The
assert keyword. |
static int |
LITERAL_BOOLEAN
The
boolean keyword. |
static int |
LITERAL_BREAK
The
break keyword. |
static int |
LITERAL_BYTE
The
byte keyword. |
static int |
LITERAL_CASE
The
case keyword. |
static int |
LITERAL_CATCH
The
catch keyword. |
static int |
LITERAL_CHAR
The
char keyword. |
static int |
LITERAL_CLASS
The
class keyword. |
static int |
LITERAL_CONTINUE
The
continue keyword. |
static int |
LITERAL_DEFAULT
The
default keyword. |
static int |
LITERAL_DO
The
do keyword. |
static int |
LITERAL_DOUBLE
The
double keyword. |
static int |
LITERAL_ELSE
The
else keyword. |
static int |
LITERAL_FALSE
The
false keyword. |
static int |
LITERAL_FINALLY
The
finally keyword. |
static int |
LITERAL_FLOAT
The
float keyword. |
static int |
LITERAL_FOR
The
for keyword. |
static int |
LITERAL_IF
The
if keyword. |
static int |
LITERAL_INSTANCEOF
The
instanceof operator. |
static int |
LITERAL_INT
The
int keyword. |
static int |
LITERAL_INTERFACE
The
interface keyword. |
static int |
LITERAL_LONG
The
long keyword. |
static int |
LITERAL_NATIVE
The
native keyword. |
static int |
LITERAL_NEW
The
new keyword. |
static int |
LITERAL_NULL
The
null keyword. |
static int |
LITERAL_PRIVATE
The
private keyword. |
static int |
LITERAL_PROTECTED
The
protected keyword. |
static int |
LITERAL_PUBLIC
The
public keyword. |
static int |
LITERAL_RETURN
The
return keyword. |
static int |
LITERAL_SHORT
The
short keyword. |
static int |
LITERAL_STATIC
The
static keyword. |
static int |
LITERAL_SUPER
The
super keyword. |
static int |
LITERAL_SWITCH
The
switch keyword. |
static int |
LITERAL_SYNCHRONIZED
The
synchronized keyword. |
static int |
LITERAL_THIS
The
this keyword. |
static int |
LITERAL_THROW
The
throw keyword. |
static int |
LITERAL_THROWS
The
throws keyword. |
static int |
LITERAL_TRANSIENT
The
transient keyword. |
static int |
LITERAL_TRUE
The
true keyword. |
static int |
LITERAL_TRY
The
try keyword. |
static int |
LITERAL_VOID
The
void keyword. |
static int |
LITERAL_VOLATILE
The
volatile keyword. |
static int |
LITERAL_WHILE
The
while keyword. |
static int |
LNOT
The
! (logical complement) operator. |
static int |
LOR
The
|| (conditional OR) operator. |
static int |
LPAREN
A left parenthesis (
( ). |
static int |
LT
The
< (less than) operator. |
static int |
METHOD_CALL
A method call.
|
static int |
METHOD_DEF
A method declaration.
|
static int |
METHOD_REF
A reference to a method or constructor without arguments.
|
static int |
MINUS
The
- (subtraction) operator. |
static int |
MINUS_ASSIGN
The
-= (subtraction assignment) operator. |
static int |
MOD
The
% (remainder) operator. |
static int |
MOD_ASSIGN
The
%= (remainder assignment) operator. |
static int |
MODIFIERS
Modifiers for type, method, and field declarations.
|
static int |
NOT_EQUAL
The
!= (not equal) operator. |
static int |
NUM_DOUBLE
A double precision floating point literal.
|
static int |
NUM_FLOAT
A single precision floating point literal.
|
static int |
NUM_INT
An integer literal.
|
static int |
NUM_LONG
A long integer literal.
|
static int |
OBJBLOCK
An object block.
|
static int |
PACKAGE_DEF
The package declaration.
|
static int |
PARAMETER_DEF
A parameter declaration.
|
static int |
PARAMETERS
A list of parameters to a method or constructor.
|
static int |
PLUS
The
+ (addition) operator. |
static int |
PLUS_ASSIGN
The
+= (addition assignment) operator. |
static int |
POST_DEC
The
-- (postfix decrement) operator. |
static int |
POST_INC
The
++ (postfix increment) operator. |
static int |
QUESTION
The
? (conditional) operator. |
static int |
RBRACK
The
] symbol. |
static int |
RCURLY
A right curly brace (
} ). |
static int |
RESOURCE
A resource in the Java 7 try-with-resources construct.
|
static int |
RESOURCE_SPECIFICATION
The Java 7 try-with-resources construct.
|
static int |
RESOURCES
A list of resources in the Java 7 try-with-resources construct.
|
static int |
RPAREN
A right parenthesis (
) ). |
static int |
SEMI
The statement terminator (
; ). |
static int |
SINGLE_LINE_COMMENT
Beginning of single line comment: '//'.
|
static int |
SL
The
<< (shift left) operator. |
static int |
SL_ASSIGN
The
<<= (left shift assignment) operator. |
static int |
SLIST
A list of statements.
|
static int |
SR
The
>> (signed shift right) operator. |
static int |
SR_ASSIGN
The
>>= (signed right shift assignment)
operator. |
static int |
STAR
The
* (multiplication or wildcard) operator. |
static int |
STAR_ASSIGN
The
*= (multiplication assignment) operator. |
static int |
STATIC_IMPORT
A static import declaration.
|
static int |
STATIC_INIT
A static initialization block.
|
static int |
STRICTFP
The
strictfp keyword. |
static int |
STRING_LITERAL
A string literal.
|
static int |
SUPER_CTOR_CALL
A super constructor call.
|
static int |
TYPE
A type.
|
static int |
TYPE_ARGUMENT
A type arguments to a type reference or a method/ctor invocation.
|
static int |
TYPE_ARGUMENTS
A list of type arguments to a type reference or
a method/ctor invocation.
|
static int |
TYPE_EXTENSION_AND
The
& symbol when used in a generic upper or lower bounds constrain
e.g. Comparable<T extends Serializable & CharSequence> . |
static int |
TYPE_LOWER_BOUNDS
A lower bounds on a wildcard type argument.
|
static int |
TYPE_PARAMETER
A type parameter to a class, interface or method definition.
|
static int |
TYPE_PARAMETERS
A list of type parameters to a class, interface or
method definition.
|
static int |
TYPE_UPPER_BOUNDS
An upper bounds on a wildcard type argument or type parameter.
|
static int |
TYPECAST
A type-cast.
|
static int |
UNARY_MINUS
The
- (unary minus) operator. |
static int |
UNARY_PLUS
The
+ (unary plus) operator. |
static int |
VARIABLE_DEF
A field or local variable declaration.
|
static int |
WILDCARD_TYPE
The type that refers to all types.
|
public static final int EOF
PACKAGE_DEF
,
IMPORT
,
CLASS_DEF
,
INTERFACE_DEF
,
Constant Field Valuespublic static final int MODIFIERS
public static final int OBJBLOCK
public static final int SLIST
public static final int CTOR_DEF
For example:
public SpecialEntry(int value, String text) { this.value = value; this.text = text; }
parses as:
+--CTOR_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--IDENT (SpecialEntry) +--LPAREN (() +--PARAMETERS | +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (value) +--COMMA (,) +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--IDENT (String) +--IDENT (text) +--RPAREN ()) +--SLIST ({) | +--EXPR | +--ASSIGN (=) | +--DOT (.) | +--LITERAL_THIS (this) +--IDENT (value) +--IDENT (value) +--SEMI (;) +--EXPR | +--ASSIGN (=) | +--DOT (.) | +--LITERAL_THIS (this) +--IDENT (text) +--IDENT (text) +--SEMI (;) +--RCURLY (})
OBJBLOCK
,
CLASS_DEF
,
Constant Field Valuespublic static final int METHOD_DEF
For example:
public static int square(int x) { return x*x; }
parses as:
+--METHOD_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--LITERAL_STATIC (static) +--TYPE | +--LITERAL_INT (int) +--IDENT (square) +--PARAMETERS | +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (x) +--SLIST ({) | +--LITERAL_RETURN (return) | +--EXPR | +--STAR (*) | +--IDENT (x) +--IDENT (x) +--SEMI (;) +--RCURLY (})
MODIFIERS
,
TYPE_PARAMETERS
,
TYPE
,
IDENT
,
PARAMETERS
,
LITERAL_THROWS
,
SLIST
,
OBJBLOCK
,
Constant Field Valuespublic static final int VARIABLE_DEF
MODIFIERS
,
TYPE
,
IDENT
,
ASSIGN
,
Constant Field Valuespublic static final int INSTANCE_INIT
public static final int STATIC_INIT
public static final int TYPE
public static final int CLASS_DEF
For example:
public class MyClass implements Serializable { }
parses as:
+--CLASS_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--LITERAL_CLASS (class) +--IDENT (MyClass) +--EXTENDS_CLAUSE +--IMPLEMENTS_CLAUSE | +--IDENT (Serializable) +--OBJBLOCK | +--LCURLY ({) +--RCURLY (})
public static final int INTERFACE_DEF
For example:
public interface MyInterface { }
parses as:
+--INTERFACE_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--LITERAL_INTERFACE (interface) +--IDENT (MyInterface) +--EXTENDS_CLAUSE +--OBJBLOCK | +--LCURLY ({) +--RCURLY (})
public static final int PACKAGE_DEF
For example:
package com.puppycrawl.tools.checkstyle.api;
parses as:
+--PACKAGE_DEF (package) | +--ANNOTATIONS +--DOT (.) | +--DOT (.) | +--DOT (.) | +--DOT (.) | +--IDENT (com) +--IDENT (puppycrawl) +--IDENT (tools) +--IDENT (checkstyle) +--IDENT (api) +--SEMI (;)
DOT
,
IDENT
,
SEMI
,
ANNOTATIONS
,
FullIdent
,
Constant Field Valuespublic static final int ARRAY_DECLARATOR
If the array declaration represents a type, then the type of the array elements is the first child. Multidimensional arrays may be regarded as arrays of arrays. In other words, the first child of the array declaration is another array declaration.
For example:
int[] x;
parses as:
+--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--ARRAY_DECLARATOR ([) | +--LITERAL_INT (int) +--IDENT (x) +--SEMI (;)
The array declaration may also represent an inline array definition. In this case, the first child will be either an expression specifying the length of the array or an array initialization block.
public static final int EXTENDS_CLAUSE
extends
keyword is not explicitly used. The child
is an optional identifier.
For example:
extends java.util.LinkedList
parses as:
+--EXTENDS_CLAUSE | +--DOT (.) | +--DOT (.) | +--IDENT (java) +--IDENT (util) +--IDENT (LinkedList)
IDENT
,
DOT
,
CLASS_DEF
,
INTERFACE_DEF
,
FullIdent
,
Constant Field Valuespublic static final int IMPLEMENTS_CLAUSE
For example:
implements Serializable, Comparable
parses as:
+--IMPLEMENTS_CLAUSE | +--IDENT (Serializable) +--COMMA (,) +--IDENT (Comparable)
public static final int PARAMETERS
For example
int start, int end
parses as:
+--PARAMETERS | +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (start) +--COMMA (,) +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (end)
PARAMETER_DEF
,
COMMA
,
METHOD_DEF
,
CTOR_DEF
,
Constant Field Valuespublic static final int PARAMETER_DEF
MODIFIERS
,
TYPE
,
IDENT
,
PARAMETERS
,
ELLIPSIS
,
Constant Field Valuespublic static final int LABELED_STAT
For example:
outside: ;
parses as:
+--LABELED_STAT (:) | +--IDENT (outside) +--EMPTY_STAT (;)
public static final int TYPECAST
For example:
(String)it.next()
parses as:
+--TYPECAST (() | +--TYPE | +--IDENT (String) +--RPAREN ()) +--METHOD_CALL (() | +--DOT (.) | +--IDENT (it) +--IDENT (next) +--ELIST +--RPAREN ())
public static final int INDEX_OP
For example:
ar[2] = 5;
parses as:
+--EXPR | +--ASSIGN (=) | +--INDEX_OP ([) | +--IDENT (ar) +--EXPR | +--NUM_INT (2) +--NUM_INT (5) +--SEMI (;)
EXPR
,
Constant Field Valuespublic static final int POST_INC
++
(postfix increment) operator.public static final int POST_DEC
--
(postfix decrement) operator.public static final int METHOD_CALL
For example:
Math.random()
parses as:
+--METHOD_CALL (() | +--DOT (.) | +--IDENT (Math) +--IDENT (random) +--ELIST +--RPAREN ())
IDENT
,
TYPE_ARGUMENTS
,
DOT
,
ELIST
,
RPAREN
,
FullIdent
,
Constant Field Valuespublic static final int METHOD_REF
DOUBLE_COLON
token does not appear in the tree.
For example:
String::compareToIgnoreCase
parses as:
+--METHOD_REF (::) | +--IDENT (String) +--IDENT (compareToIgnoreCase)
IDENT
,
DOUBLE_COLON
,
Constant Field Valuespublic static final int EXPR
For example:
x = 4 + 3 * 5 + (30 + 26) / 4 + 5 % 4 + (1<<3);
parses as:
+--EXPR | +--ASSIGN (=) | +--IDENT (x) +--PLUS (+) | +--PLUS (+) | +--PLUS (+) | +--PLUS (+) | +--NUM_INT (4) +--STAR (*) | +--NUM_INT (3) +--NUM_INT (5) +--DIV (/) | +--LPAREN (() +--PLUS (+) | +--NUM_INT (30) +--NUM_INT (26) +--RPAREN ()) +--NUM_INT (4) +--MOD (%) | +--NUM_INT (5) +--NUM_INT (4) +--LPAREN (() +--SL (<<) | +--NUM_INT (1) +--NUM_INT (3) +--RPAREN ()) +--SEMI (;)
ELIST
,
ASSIGN
,
LPAREN
,
RPAREN
,
Constant Field Valuespublic static final int ARRAY_INIT
new
.
For example:
int[] y = { 1, 2, };
parses as:
+--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--ARRAY_DECLARATOR ([) | +--LITERAL_INT (int) +--IDENT (y) +--ASSIGN (=) | +--ARRAY_INIT ({) | +--EXPR | +--NUM_INT (1) +--COMMA (,) +--EXPR | +--NUM_INT (2) +--COMMA (,) +--RCURLY (}) +--SEMI (;)
Also consider:
int[] z = new int[] { 1, 2, };
which parses as:
+--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--ARRAY_DECLARATOR ([) | +--LITERAL_INT (int) +--IDENT (z) +--ASSIGN (=) | +--EXPR | +--LITERAL_NEW (new) | +--LITERAL_INT (int) +--ARRAY_DECLARATOR ([) +--ARRAY_INIT ({) | +--EXPR | +--NUM_INT (1) +--COMMA (,) +--EXPR | +--NUM_INT (2) +--COMMA (,) +--RCURLY (})
ARRAY_DECLARATOR
,
TYPE
,
LITERAL_NEW
,
COMMA
,
Constant Field Valuespublic static final int IMPORT
For example:
import java.io.IOException;
parses as:
+--IMPORT (import) | +--DOT (.) | +--DOT (.) | +--IDENT (java) +--IDENT (io) +--IDENT (IOException) +--SEMI (;)
DOT
,
IDENT
,
STAR
,
SEMI
,
FullIdent
,
Constant Field Valuespublic static final int UNARY_MINUS
-
(unary minus) operator.public static final int UNARY_PLUS
+
(unary plus) operator.public static final int CASE_GROUP
For example:
case 0: case 1: case 2: x = 3; break;
parses as:
+--CASE_GROUP | +--LITERAL_CASE (case) | +--EXPR | +--NUM_INT (0) +--LITERAL_CASE (case) | +--EXPR | +--NUM_INT (1) +--LITERAL_CASE (case) | +--EXPR | +--NUM_INT (2) +--SLIST | +--EXPR | +--ASSIGN (=) | +--IDENT (x) +--NUM_INT (3) +--SEMI (;) +--LITERAL_BREAK (break) | +--SEMI (;)
LITERAL_CASE
,
LITERAL_DEFAULT
,
LITERAL_SWITCH
,
Constant Field Valuespublic static final int ELIST
LITERAL_NEW
,
FOR_INIT
,
FOR_ITERATOR
,
EXPR
,
METHOD_CALL
,
CTOR_CALL
,
SUPER_CTOR_CALL
,
Constant Field Valuespublic static final int FOR_INIT
LITERAL_FOR
. The children of this element may be
a comma separated list of variable declarations, an expression
list, or empty.VARIABLE_DEF
,
ELIST
,
LITERAL_FOR
,
Constant Field Valuespublic static final int FOR_CONDITION
LITERAL_FOR
. The child of this element is an
optional expression.EXPR
,
LITERAL_FOR
,
Constant Field Valuespublic static final int FOR_ITERATOR
LITERAL_FOR
. The child of this element is an
optional expression list.ELIST
,
LITERAL_FOR
,
Constant Field Valuespublic static final int EMPTY_STAT
SLIST
for a for
or while
loop body.public static final int FINAL
final
keyword.MODIFIERS
,
Constant Field Valuespublic static final int ABSTRACT
abstract
keyword.MODIFIERS
,
Constant Field Valuespublic static final int STRICTFP
strictfp
keyword.MODIFIERS
,
Constant Field Valuespublic static final int SUPER_CTOR_CALL
ELIST
,
RPAREN
,
SEMI
,
CTOR_CALL
,
Constant Field Valuespublic static final int CTOR_CALL
For example:
this(1);
parses as:
+--CTOR_CALL (this) | +--LPAREN (() +--ELIST | +--EXPR | +--NUM_INT (1) +--RPAREN ()) +--SEMI (;)
ELIST
,
RPAREN
,
SEMI
,
SUPER_CTOR_CALL
,
Constant Field Valuespublic static final int SEMI
;
). Depending on the
context, this make occur as a sibling, a child, or not at all.PACKAGE_DEF
,
IMPORT
,
SLIST
,
ARRAY_INIT
,
LITERAL_FOR
,
Constant Field Valuespublic static final int RBRACK
]
symbol.INDEX_OP
,
ARRAY_DECLARATOR
,
Constant Field Valuespublic static final int LITERAL_VOID
void
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_BOOLEAN
boolean
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_BYTE
byte
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_CHAR
char
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_SHORT
short
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_INT
int
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_FLOAT
float
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_LONG
long
keyword.TYPE
,
Constant Field Valuespublic static final int LITERAL_DOUBLE
double
keyword.TYPE
,
Constant Field Valuespublic static final int IDENT
public static final int DOT
.
(dot) operator.FullIdent
,
Constant Field Valuespublic static final int STAR
*
(multiplication or wildcard) operator.public static final int LITERAL_PRIVATE
private
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_PUBLIC
public
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_PROTECTED
protected
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_STATIC
static
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_TRANSIENT
transient
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_NATIVE
native
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_SYNCHRONIZED
synchronized
keyword. This may be used as a
modifier of a method or in the definition of a synchronized
block.
For example:
synchronized(this) { x++; }
parses as:
+--LITERAL_SYNCHRONIZED (synchronized) | +--LPAREN (() +--EXPR | +--LITERAL_THIS (this) +--RPAREN ()) +--SLIST ({) | +--EXPR | +--POST_INC (++) | +--IDENT (x) +--SEMI (;) +--RCURLY (}) +--RCURLY (})
public static final int LITERAL_VOLATILE
volatile
keyword.MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_CLASS
class
keyword. This element appears both
as part of a class declaration, and inline to reference a
class object.
For example:
int.class
parses as:
+--EXPR | +--DOT (.) | +--LITERAL_INT (int) +--LITERAL_CLASS (class)
DOT
,
IDENT
,
CLASS_DEF
,
FullIdent
,
Constant Field Valuespublic static final int LITERAL_INTERFACE
interface
keyword. This token appears in
interface definition.INTERFACE_DEF
,
Constant Field Valuespublic static final int LCURLY
{
).OBJBLOCK
,
ARRAY_INIT
,
SLIST
,
Constant Field Valuespublic static final int RCURLY
}
).OBJBLOCK
,
ARRAY_INIT
,
SLIST
,
Constant Field Valuespublic static final int COMMA
,
(comma) operator.public static final int LPAREN
(
).LITERAL_FOR
,
LITERAL_NEW
,
EXPR
,
LITERAL_SWITCH
,
LITERAL_CATCH
,
Constant Field Valuespublic static final int RPAREN
)
).LITERAL_FOR
,
LITERAL_NEW
,
METHOD_CALL
,
TYPECAST
,
EXPR
,
LITERAL_SWITCH
,
LITERAL_CATCH
,
Constant Field Valuespublic static final int LITERAL_THIS
this
keyword.EXPR
,
CTOR_CALL
,
Constant Field Valuespublic static final int LITERAL_SUPER
super
keyword.EXPR
,
SUPER_CTOR_CALL
,
Constant Field Valuespublic static final int ASSIGN
=
(assignment) operator.public static final int LITERAL_THROWS
throws
keyword. The children are a number of
one or more identifiers separated by commas.IDENT
,
DOT
,
COMMA
,
METHOD_DEF
,
CTOR_DEF
,
FullIdent
,
Constant Field Valuespublic static final int COLON
:
(colon) operator. This will appear as part
of the conditional operator (? :
).QUESTION
,
LABELED_STAT
,
CASE_GROUP
,
Constant Field Valuespublic static final int DOUBLE_COLON
::
(double colon) separator.
It is part of Java 8 syntax that is used for method reference.
The token does not appear in tree, METHOD_REF
should be used instead.METHOD_REF
,
Constant Field Valuespublic static final int LITERAL_IF
if
keyword.
For example:
if(optimistic) { message = "half full"; } else { message = "half empty"; }
parses as:
+--LITERAL_IF (if) | +--LPAREN (() +--EXPR | +--IDENT (optimistic) +--RPAREN ()) +--SLIST ({) | +--EXPR | +--ASSIGN (=) | +--IDENT (message) +--STRING_LITERAL ("half full") +--SEMI (;) +--RCURLY (}) +--LITERAL_ELSE (else) | +--SLIST ({) | +--EXPR | +--ASSIGN (=) | +--IDENT (message) +--STRING_LITERAL ("half empty") +--SEMI (;) +--RCURLY (})
LPAREN
,
EXPR
,
RPAREN
,
SLIST
,
EMPTY_STAT
,
LITERAL_ELSE
,
Constant Field Valuespublic static final int LITERAL_FOR
for
keyword. The children are (
,
an initializer, a condition, an iterator, a )
and
either a statement list, a single expression, or an empty
statement.
For example:
for(int i = 0, n = myArray.length; i < n; i++) { }
parses as:
+--LITERAL_FOR (for) | +--LPAREN (() +--FOR_INIT | +--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (i) +--ASSIGN (=) | +--EXPR | +--NUM_INT (0) +--COMMA (,) +--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (n) +--ASSIGN (=) | +--EXPR | +--DOT (.) | +--IDENT (myArray) +--IDENT (length) +--SEMI (;) +--FOR_CONDITION | +--EXPR | +--LT (<) | +--IDENT (i) +--IDENT (n) +--SEMI (;) +--FOR_ITERATOR | +--ELIST | +--EXPR | +--POST_INC (++) | +--IDENT (i) +--RPAREN ()) +--SLIST ({) | +--RCURLY (})
LPAREN
,
FOR_INIT
,
SEMI
,
FOR_CONDITION
,
FOR_ITERATOR
,
RPAREN
,
SLIST
,
EMPTY_STAT
,
EXPR
,
Constant Field Valuespublic static final int LITERAL_WHILE
while
keyword.
For example:
while(line != null) { process(line); line = in.readLine(); }
parses as:
+--LITERAL_WHILE (while) | +--LPAREN (() +--EXPR | +--NOT_EQUAL (!=) | +--IDENT (line) +--LITERAL_NULL (null) +--RPAREN ()) +--SLIST ({) | +--EXPR | +--METHOD_CALL (() | +--IDENT (process) +--ELIST | +--EXPR | +--IDENT (line) +--RPAREN ()) +--SEMI (;) +--EXPR | +--ASSIGN (=) | +--IDENT (line) +--METHOD_CALL (() | +--DOT (.) | +--IDENT (in) +--IDENT (readLine) +--ELIST +--RPAREN ()) +--SEMI (;) +--RCURLY (})
public static final int LITERAL_DO
do
keyword. Note the the while token does not
appear as part of the do-while construct.
For example:
do { x = rand.nextInt(10); } while(x < 5);
parses as:
+--LITERAL_DO (do) | +--SLIST ({) | +--EXPR | +--ASSIGN (=) | +--IDENT (x) +--METHOD_CALL (() | +--DOT (.) | +--IDENT (rand) +--IDENT (nextInt) +--ELIST | +--EXPR | +--NUM_INT (10) +--RPAREN ()) +--SEMI (;) +--RCURLY (}) +--DO_WHILE (while) +--LPAREN (() +--EXPR | +--LT (<) | +--IDENT (x) +--NUM_INT (5) +--RPAREN ()) +--SEMI (;)
SLIST
,
EXPR
,
EMPTY_STAT
,
LPAREN
,
RPAREN
,
SEMI
,
Constant Field Valuespublic static final int DO_WHILE
while
in do-while loop.LITERAL_DO
,
Constant Field Valuespublic static final int LITERAL_BREAK
break
keyword. The first child is an optional
identifier and the last child is a semicolon.IDENT
,
SEMI
,
SLIST
,
Constant Field Valuespublic static final int LITERAL_CONTINUE
continue
keyword. The first child is an
optional identifier and the last child is a semicolon.IDENT
,
SEMI
,
SLIST
,
Constant Field Valuespublic static final int LITERAL_RETURN
return
keyword. The first child is an
optional expression for the return value. The last child is a
semi colon.EXPR
,
SEMI
,
SLIST
,
Constant Field Valuespublic static final int LITERAL_SWITCH
switch
keyword.
For example:
switch(type) { case 0: background = Color.blue; break; case 1: background = Color.red; break; default: background = Color.green; break; }
parses as:
+--LITERAL_SWITCH (switch) | +--LPAREN (() +--EXPR | +--IDENT (type) +--RPAREN ()) +--LCURLY ({) +--CASE_GROUP | +--LITERAL_CASE (case) | +--EXPR | +--NUM_INT (0) +--SLIST | +--EXPR | +--ASSIGN (=) | +--IDENT (background) +--DOT (.) | +--IDENT (Color) +--IDENT (blue) +--SEMI (;) +--LITERAL_BREAK (break) | +--SEMI (;) +--CASE_GROUP | +--LITERAL_CASE (case) | +--EXPR | +--NUM_INT (1) +--SLIST | +--EXPR | +--ASSIGN (=) | +--IDENT (background) +--DOT (.) | +--IDENT (Color) +--IDENT (red) +--SEMI (;) +--LITERAL_BREAK (break) | +--SEMI (;) +--CASE_GROUP | +--LITERAL_DEFAULT (default) +--SLIST | +--EXPR | +--ASSIGN (=) | +--IDENT (background) +--DOT (.) | +--IDENT (Color) +--IDENT (green) +--SEMI (;) +--LITERAL_BREAK (break) | +--SEMI (;) +--RCURLY (})
LPAREN
,
EXPR
,
RPAREN
,
LCURLY
,
CASE_GROUP
,
RCURLY
,
SLIST
,
Constant Field Valuespublic static final int LITERAL_THROW
throw
keyword. The first child is an
expression that evaluates to a Throwable
instance.public static final int LITERAL_ELSE
else
keyword. This appears as a child of an
if
statement.SLIST
,
EXPR
,
EMPTY_STAT
,
LITERAL_IF
,
Constant Field Valuespublic static final int LITERAL_CASE
case
keyword. The first child is a constant
expression that evaluates to an integer.CASE_GROUP
,
EXPR
,
Constant Field Valuespublic static final int LITERAL_DEFAULT
default
keyword. This element has no
children.CASE_GROUP
,
MODIFIERS
,
Constant Field Valuespublic static final int LITERAL_TRY
try
keyword. The children are a statement
list, zero or more catch blocks and then an optional finally
block.
For example:
try { FileReader in = new FileReader("abc.txt"); } catch(IOException ioe) { } finally { }
parses as:
+--LITERAL_TRY (try) | +--SLIST ({) | +--VARIABLE_DEF | +--MODIFIERS +--TYPE | +--IDENT (FileReader) +--IDENT (in) +--ASSIGN (=) | +--EXPR | +--LITERAL_NEW (new) | +--IDENT (FileReader) +--LPAREN (() +--ELIST | +--EXPR | +--STRING_LITERAL ("abc.txt") +--RPAREN ()) +--SEMI (;) +--RCURLY (}) +--LITERAL_CATCH (catch) | +--LPAREN (() +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--IDENT (IOException) +--IDENT (ioe) +--RPAREN ()) +--SLIST ({) | +--RCURLY (}) +--LITERAL_FINALLY (finally) | +--SLIST ({) | +--RCURLY (}) +--RCURLY (})
public static final int RESOURCE_SPECIFICATION
For example:
try (Foo foo = new Foo(); Bar bar = new Bar()) { }
parses as:
+--LITERAL_TRY (try) | +--RESOURCE_SPECIFICATION | +--LPAREN (() +--RESOURCES | +--RESOURCE | +--MODIFIERS +--TYPE | +--IDENT (Foo) +--IDENT (foo) +--ASSIGN (=) +--EXPR | +--LITERAL_NEW (new) | +--IDENT (Foo) +--LPAREN (() +--ELIST +--RPAREN ()) +--SEMI (;) +--RESOURCE | +--MODIFIERS +--TYPE | +--IDENT (Bar) +--IDENT (bar) +--ASSIGN (=) +--EXPR | +--LITERAL_NEW (new) | +--IDENT (Bar) +--LPAREN (() +--ELIST +--RPAREN ()) +--RPAREN ()) +--SLIST ({) +--RCURLY (})
Also consider:
try (BufferedReader br = new BufferedReader(new FileReader(path))) { return br.readLine(); }
which parses as:
+--LITERAL_TRY (try) | +--RESOURCE_SPECIFICATION | +--LPAREN (() +--RESOURCES | +--RESOURCE | +--MODIFIERS +--TYPE | +--IDENT (BufferedReader) +--IDENT (br) +--ASSIGN (=) +--EXPR | +--LITERAL_NEW (new) | +--IDENT (FileReader) +--LPAREN (() +--ELIST | +--EXPR | +--LITERAL_NEW (new) | +--IDENT (BufferedReader) +--LPAREN (() +--ELIST | +--EXPR | +--IDENT (path) +--RPAREN ()) +--RPAREN ()) +--RPAREN ()) +--SLIST ({) | +--LITERAL_RETURN (return) | +--EXPR | +--METHOD_CALL (() | +--DOT (.) | +--IDENT (br) +--IDENT (readLine) +--ELIST +--RPAREN ()) +--SEMI (;) +--RCURLY (})
LPAREN
,
RESOURCES
,
RESOURCE
,
SEMI
,
RPAREN
,
LITERAL_TRY
,
Constant Field Valuespublic static final int RESOURCES
RESOURCE_SPECIFICATION
,
Constant Field Valuespublic static final int RESOURCE
RESOURCES
,
RESOURCE_SPECIFICATION
,
Constant Field Valuespublic static final int LITERAL_CATCH
catch
keyword.LPAREN
,
PARAMETER_DEF
,
RPAREN
,
SLIST
,
LITERAL_TRY
,
Constant Field Valuespublic static final int LITERAL_FINALLY
finally
keyword.SLIST
,
LITERAL_TRY
,
Constant Field Valuespublic static final int PLUS_ASSIGN
+=
(addition assignment) operator.public static final int MINUS_ASSIGN
-=
(subtraction assignment) operator.public static final int STAR_ASSIGN
*=
(multiplication assignment) operator.public static final int DIV_ASSIGN
/=
(division assignment) operator.public static final int MOD_ASSIGN
%=
(remainder assignment) operator.public static final int SR_ASSIGN
>>=
(signed right shift assignment)
operator.public static final int BSR_ASSIGN
>>>=
(unsigned right shift assignment)
operator.public static final int SL_ASSIGN
<<=
(left shift assignment) operator.public static final int BAND_ASSIGN
&=
(bitwise AND assignment) operator.public static final int BXOR_ASSIGN
^=
(bitwise exclusive OR assignment) operator.public static final int BOR_ASSIGN
|=
(bitwise OR assignment) operator.public static final int QUESTION
?
(conditional) operator. Technically,
the colon is also part of this operator, but it appears as a
separate token.
For example:
(quantity == 1) ? "": "s"
parses as:
+--QUESTION (?) | +--LPAREN (() +--EQUAL (==) | +--IDENT (quantity) +--NUM_INT (1) +--RPAREN ()) +--STRING_LITERAL ("") +--COLON (:) +--STRING_LITERAL ("s")
public static final int LOR
||
(conditional OR) operator.public static final int LAND
&&
(conditional AND) operator.public static final int BOR
|
(bitwise OR) operator.public static final int BXOR
^
(bitwise exclusive OR) operator.public static final int BAND
&
(bitwise AND) operator.public static final int NOT_EQUAL
!=
(not equal) operator.EXPR
,
Constant Field Valuespublic static final int EQUAL
==
(equal) operator.EXPR
,
Constant Field Valuespublic static final int LT
<
(less than) operator.EXPR
,
Constant Field Valuespublic static final int GT
>
(greater than) operator.EXPR
,
Constant Field Valuespublic static final int LE
<=
(less than or equal) operator.EXPR
,
Constant Field Valuespublic static final int GE
>=
(greater than or equal) operator.EXPR
,
Constant Field Valuespublic static final int LITERAL_INSTANCEOF
instanceof
operator. The first child is an
object reference or something that evaluates to an object
reference. The second child is a reference type.EXPR
,
METHOD_CALL
,
IDENT
,
DOT
,
TYPE
,
FullIdent
,
Constant Field Valuespublic static final int SL
<<
(shift left) operator.public static final int SR
>>
(signed shift right) operator.public static final int BSR
>>>
(unsigned shift right) operator.public static final int PLUS
+
(addition) operator.public static final int MINUS
-
(subtraction) operator.public static final int DIV
/
(division) operator.public static final int MOD
%
(remainder) operator.public static final int INC
++
(prefix increment) operator.public static final int DEC
--
(prefix decrement) operator.public static final int BNOT
~
(bitwise complement) operator.public static final int LNOT
!
(logical complement) operator.public static final int LITERAL_TRUE
true
keyword.public static final int LITERAL_FALSE
false
keyword.public static final int LITERAL_NULL
null
keyword.public static final int LITERAL_NEW
new
keyword. This element is used to define
new instances of objects, new arrays, and new anonymous inner
classes.
For example:
new ArrayList(50)
parses as:
+--LITERAL_NEW (new) | +--IDENT (ArrayList) +--LPAREN (() +--ELIST | +--EXPR | +--NUM_INT (50) +--RPAREN ())
For example:
new float[] { 3.0f, 4.0f };
parses as:
+--LITERAL_NEW (new) | +--LITERAL_FLOAT (float) +--ARRAY_DECLARATOR ([) +--ARRAY_INIT ({) | +--EXPR | +--NUM_FLOAT (3.0f) +--COMMA (,) +--EXPR | +--NUM_FLOAT (4.0f) +--RCURLY (})
For example:
new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(".java"); } }
parses as:
+--LITERAL_NEW (new) | +--IDENT (FilenameFilter) +--LPAREN (() +--ELIST +--RPAREN ()) +--OBJBLOCK | +--LCURLY ({) +--METHOD_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--TYPE | +--LITERAL_BOOLEAN (boolean) +--IDENT (accept) +--PARAMETERS | +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--IDENT (File) +--IDENT (dir) +--COMMA (,) +--PARAMETER_DEF | +--MODIFIERS +--TYPE | +--IDENT (String) +--IDENT (name) +--SLIST ({) | +--LITERAL_RETURN (return) | +--EXPR | +--METHOD_CALL (() | +--DOT (.) | +--IDENT (name) +--IDENT (endsWith) +--ELIST | +--EXPR | +--STRING_LITERAL (".java") +--RPAREN ()) +--SEMI (;) +--RCURLY (}) +--RCURLY (})
IDENT
,
DOT
,
LPAREN
,
ELIST
,
RPAREN
,
OBJBLOCK
,
ARRAY_INIT
,
FullIdent
,
Constant Field Valuespublic static final int NUM_INT
public static final int CHAR_LITERAL
public static final int STRING_LITERAL
public static final int NUM_FLOAT
F
or f
suffix.public static final int NUM_LONG
L
or l
(ell) suffix.public static final int NUM_DOUBLE
D
or d
suffix.public static final int LITERAL_ASSERT
assert
keyword. This is only for Java 1.4 and
later.
For example:
assert(x==4);
parses as:
+--LITERAL_ASSERT (assert) | +--EXPR | +--LPAREN (() +--EQUAL (==) | +--IDENT (x) +--NUM_INT (4) +--RPAREN ()) +--SEMI (;)
public static final int STATIC_IMPORT
For example:
import static java.io.IOException;
parses as:
+--STATIC_IMPORT (import) | +--LITERAL_STATIC +--DOT (.) | +--DOT (.) | +--IDENT (java) +--IDENT (io) +--IDENT (IOException) +--SEMI (;)
LITERAL_STATIC
,
DOT
,
IDENT
,
STAR
,
SEMI
,
FullIdent
,
Constant Field Valuespublic static final int ENUM_DEF
For example:
public enum MyEnum implements Serializable { FIRST_CONSTANT, SECOND_CONSTANT; public void someMethod() { } }
parses as:
+--ENUM_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--ENUM (enum) +--IDENT (MyEnum) +--EXTENDS_CLAUSE +--IMPLEMENTS_CLAUSE | +--IDENT (Serializable) +--OBJBLOCK | +--LCURLY ({) +--ENUM_CONSTANT_DEF | +--IDENT (FIRST_CONSTANT) +--COMMA (,) +--ENUM_CONSTANT_DEF | +--IDENT (SECOND_CONSTANT) +--SEMI (;) +--METHOD_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--TYPE | +--LITERAL_void (void) +--IDENT (someMethod) +--LPAREN (() +--PARAMETERS +--RPAREN ()) +--SLIST ({) | +--RCURLY (}) +--RCURLY (})
MODIFIERS
,
ENUM
,
IDENT
,
EXTENDS_CLAUSE
,
IMPLEMENTS_CLAUSE
,
OBJBLOCK
,
LITERAL_NEW
,
ENUM_CONSTANT_DEF
,
Constant Field Valuespublic static final int ENUM
enum
keyword. This element appears
as part of an enum declaration.public static final int ENUM_CONSTANT_DEF
For example:
SOME_CONSTANT(1) { public void someMethodOverriddenFromMainBody() { } }
parses as:
+--ENUM_CONSTANT_DEF | +--ANNOTATIONS +--IDENT (SOME_CONSTANT) +--LPAREN (() +--ELIST | +--EXPR | +--NUM_INT (1) +--RPAREN ()) +--OBJBLOCK | +--LCURLY ({) | +--METHOD_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--TYPE | +--LITERAL_void (void) +--IDENT (someMethodOverriddenFromMainBody) +--LPAREN (() +--PARAMETERS +--RPAREN ()) +--SLIST ({) | +--RCURLY (}) +--RCURLY (})
ANNOTATIONS
,
MODIFIERS
,
IDENT
,
ELIST
,
OBJBLOCK
,
Constant Field Valuespublic static final int FOR_EACH_CLAUSE
LITERAL_FOR
. The children of this element may be
a parameter definition, the colon literal and an expression.
For example:
for (int value : values) { doSmth(); }
parses as:
--LITERAL_FOR (for) |--LPAREN (() |--FOR_EACH_CLAUSE | |--VARIABLE_DEF | | |--MODIFIERS | | |--TYPE | | | `--LITERAL_INT (int) | | `--IDENT (value) | |--COLON (:) | `--EXPR | `--IDENT (values |--RPAREN ()) `--SLIST ({) |--EXPR | `--METHOD_CALL (() | |--IDENT (doSmth) | |--ELIST | `--RPAREN ()) |--SEMI (;) `--RCURLY (})
VARIABLE_DEF
,
ELIST
,
LITERAL_FOR
,
Constant Field Valuespublic static final int ANNOTATION_DEF
For example:
public @interface MyAnnotation { int someValue(); }
parses as:
+--ANNOTATION_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--AT (@) +--LITERAL_INTERFACE (interface) +--IDENT (MyAnnotation) +--OBJBLOCK | +--LCURLY ({) +--ANNOTATION_FIELD_DEF | +--MODIFIERS +--TYPE | +--LITERAL_INT (int) +--IDENT (someValue) +--LPAREN (() +--RPAREN ()) +--SEMI (;) +--RCURLY (})
MODIFIERS
,
LITERAL_INTERFACE
,
IDENT
,
OBJBLOCK
,
ANNOTATION_FIELD_DEF
,
Constant Field Valuespublic static final int ANNOTATION_FIELD_DEF
For example:
String someField() default "Hello world";
parses as:
+--ANNOTATION_FIELD_DEF | +--MODIFIERS +--TYPE | +--IDENT (String) +--IDENT (someField) +--LPAREN (() +--RPAREN ()) +--LITERAL_DEFAULT (default) +--STRING_LITERAL ("Hello world") +--SEMI (;)
MODIFIERS
,
TYPE
,
LITERAL_DEFAULT
,
Constant Field Valuespublic static final int ANNOTATIONS
MODIFIERS
node.
For example:
@MyAnnotation package blah;
parses as:
+--PACKAGE_DEF (package) | +--ANNOTATIONS | +--ANNOTATION | +--AT (@) +--IDENT (MyAnnotation) +--IDENT (blah) +--SEMI (;)
ANNOTATION
,
AT
,
IDENT
,
Constant Field Valuespublic static final int ANNOTATION
For example:
@MyAnnotation(someField1 = "Hello", someField2 = @SomeOtherAnnotation)
parses as:
+--ANNOTATION | +--AT (@) +--IDENT (MyAnnotation) +--LPAREN (() +--ANNOTATION_MEMBER_VALUE_PAIR | +--IDENT (someField1) +--ASSIGN (=) +--ANNOTATION | +--AT (@) +--IDENT (SomeOtherAnnotation) +--ANNOTATION_MEMBER_VALUE_PAIR | +--IDENT (someField2) +--ASSIGN (=) +--STRING_LITERAL ("Hello") +--RPAREN ())
MODIFIERS
,
IDENT
,
ANNOTATION_MEMBER_VALUE_PAIR
,
Constant Field Valuespublic static final int ANNOTATION_MEMBER_VALUE_PAIR
ANNOTATION
,
IDENT
,
Constant Field Valuespublic static final int ANNOTATION_ARRAY_INIT
For example:
{ 1, 2 }
parses as:
+--ANNOTATION_ARRAY_INIT ({) | +--NUM_INT (1) +--COMMA (,) +--NUM_INT (2) +--RCURLY (})
ANNOTATION
,
IDENT
,
ANNOTATION_MEMBER_VALUE_PAIR
,
Constant Field Valuespublic static final int TYPE_PARAMETERS
For example:
public class Blah<A, B> { }
parses as:
+--CLASS_DEF ({) | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--LITERAL_CLASS (class) +--IDENT (Blah) +--TYPE_PARAMETERS | +--GENERIC_START (<) +--TYPE_PARAMETER | +--IDENT (A) +--COMMA (,) +--TYPE_PARAMETER | +--IDENT (B) +--GENERIC_END (>) +--OBJBLOCK | +--LCURLY ({) +--NUM_INT (1) +--COMMA (,) +--NUM_INT (2) +--RCURLY (})
GENERIC_START
,
GENERIC_END
,
TYPE_PARAMETER
,
COMMA
,
Constant Field Valuespublic static final int TYPE_PARAMETER
For example:
A extends Collection
parses as:
+--TYPE_PARAMETER | +--IDENT (A) +--TYPE_UPPER_BOUNDS | +--IDENT (Collection)
IDENT
,
WILDCARD_TYPE
,
TYPE_UPPER_BOUNDS
,
Constant Field Valuespublic static final int TYPE_ARGUMENTS
For example:
public Collection<?> a;
parses as:
+--VARIABLE_DEF | +--MODIFIERS | +--LITERAL_PUBLIC (public) +--TYPE | +--IDENT (Collection) | +--TYPE_ARGUMENTS | +--GENERIC_START (<) +--TYPE_ARGUMENT | +--WILDCARD_TYPE (?) +--GENERIC_END (>) +--IDENT (a) +--SEMI (;)
GENERIC_START
,
GENERIC_END
,
TYPE_ARGUMENT
,
COMMA
,
Constant Field Valuespublic static final int TYPE_ARGUMENT
For example:
? super List
parses as:
+--TYPE_ARGUMENT | +--WILDCARD_TYPE (?) +--TYPE_LOWER_BOUNDS | +--IDENT (List)
public static final int WILDCARD_TYPE
public static final int TYPE_UPPER_BOUNDS
TYPE_PARAMETER
,
TYPE_ARGUMENT
,
WILDCARD_TYPE
,
Constant Field Valuespublic static final int TYPE_LOWER_BOUNDS
TYPE_ARGUMENT
,
WILDCARD_TYPE
,
Constant Field Valuespublic static final int AT
@
symbol - signifying an annotation instance or the prefix
to the interface literal signifying the definition of an annotation
declaration.public static final int ELLIPSIS
public static final int TYPE_EXTENSION_AND
&
symbol when used in a generic upper or lower bounds constrain
e.g. Comparable<T extends Serializable & CharSequence>
.public static final int GENERIC_START
<
symbol signifying the start of type arguments or type parameters.public static final int GENERIC_END
>
symbol signifying the end of type arguments or type parameters.public static final int LAMBDA
->
.public static final int SINGLE_LINE_COMMENT
+--SINGLE_LINE_COMMENT | +--COMMENT_CONTENT
public static final int BLOCK_COMMENT_BEGIN
+--BLOCK_COMMENT_BEGIN | +--COMMENT_CONTENT +--BLOCK_COMMENT_END
public static final int BLOCK_COMMENT_END
+--BLOCK_COMMENT_BEGIN | +--COMMENT_CONTENT +--BLOCK_COMMENT_END
public static final int COMMENT_CONTENT
+--SINGLE_LINE_COMMENT | +--COMMENT_CONTENT
+--BLOCK_COMMENT_BEGIN | +--COMMENT_CONTENT +--BLOCK_COMMENT_END
Copyright © 2001–2018. All rights reserved.