Top Description Inners Fields Constructors Methods
com.github.javaparser

public Class JavaToken

extends Object
Class Inheritance
Imports
java.util.List, .Optional, com.github.javaparser.ast.Generated

A token from a parsed source file. (Awkwardly named "Java"Token since JavaCC already generates an internal class Token.) It is a node in a double linked list called token list.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
public static final JavaToken
private int
private JavaToken
private JavaToken
private Range
private String

Constructor Summary

AccessConstructor and Description
private
public
JavaToken(int kind, String text)

pack-priv
JavaToken(Token token, List<JavaToken> tokens)

public
JavaToken(int kind)

Create a token of a certain kind.

public
JavaToken(Range range, int kind, String text, JavaToken previousToken, JavaToken nextToken)

Method Summary

Modifier and TypeMethod and Description
public String
public void
deleteToken()

Links the tokens around the current token together, making the current token disappear from the list.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public JavaToken

Returns:

the first token in the token list.
findFirstToken
()

public JavaToken

Returns:

the last token in the token list.
findLastToken
()

public JavaToken.Category
public int
public Optional<JavaToken>
public Optional<JavaToken>
public Optional<Range>
public String
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public void
insert(JavaToken newToken)

Inserts newToken into the token list just before this token.

public void
insertAfter(JavaToken newToken)

Inserts newToken into the token list just after this token.

public boolean
invalid()

Used by the parser while constructing nodes.

public void
replaceToken(JavaToken newToken)

Replaces the current token with newToken.

pack-priv void
setKind(int kind)

public void
setRange(Range range)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public TokenRange

Returns:

the token range that goes from the beginning to the end of the token list this token is a part of.
toTokenRange
()

public boolean
valid()

Used by the parser while constructing nodes.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait