com.bluemarsh.jswat.view
Class JavaTokenInfo

java.lang.Object
  |
  +--com.bluemarsh.jswat.view.BasicTokenInfo
        |
        +--com.bluemarsh.jswat.view.JavaTokenInfo
All Implemented Interfaces:
TokenInfo

public class JavaTokenInfo
extends BasicTokenInfo

Class JavaTokenInfo holds token information for Java source code.

Author:
Nathan Fiedler

Field Summary
static int TOKEN_CHARACTER
          Indicates that the token is a character.
static int TOKEN_COMMENT
          Indicates that the token is a comment.
static int TOKEN_IDENTIFIER
          Indicates that the token is a Java identifier.
static int TOKEN_KEYWORD
          Indicates that the token is a Java keyword.
static int TOKEN_LITERAL
          Indicates that the token is a literal (e.g.
static int TOKEN_NUMBER
          Indicates that the token is a number.
static int TOKEN_PRIMITIVE
          Indicates that the token is a primitive type.
static int TOKEN_STRING
          Indicates that the token is a string.
protected  int tokenType
          One fo the TOKEN_* constants.
 
Fields inherited from class com.bluemarsh.jswat.view.BasicTokenInfo
length, offset
 
Constructor Summary
JavaTokenInfo(int offset, int length, int token)
          Constructs a JavaTokenInfo with the given token type.
 
Method Summary
 int getTokenType()
          Returns this token's type.
 java.lang.String toString()
          Returns a string representation of this.
 
Methods inherited from class com.bluemarsh.jswat.view.BasicTokenInfo
getEndOffset, getLength, getStartOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOKEN_KEYWORD

public static final int TOKEN_KEYWORD
Indicates that the token is a Java keyword.

TOKEN_COMMENT

public static final int TOKEN_COMMENT
Indicates that the token is a comment.

TOKEN_PRIMITIVE

public static final int TOKEN_PRIMITIVE
Indicates that the token is a primitive type.

TOKEN_NUMBER

public static final int TOKEN_NUMBER
Indicates that the token is a number.

TOKEN_IDENTIFIER

public static final int TOKEN_IDENTIFIER
Indicates that the token is a Java identifier.

TOKEN_CHARACTER

public static final int TOKEN_CHARACTER
Indicates that the token is a character.

TOKEN_STRING

public static final int TOKEN_STRING
Indicates that the token is a string.

TOKEN_LITERAL

public static final int TOKEN_LITERAL
Indicates that the token is a literal (e.g. "null").

tokenType

protected int tokenType
One fo the TOKEN_* constants.
Constructor Detail

JavaTokenInfo

public JavaTokenInfo(int offset,
                     int length,
                     int token)
Constructs a JavaTokenInfo with the given token type.
Parameters:
offset - offset to the start of the token.
length - length of the token string.
token - token type (one of the TOKEN_* constants).
Method Detail

getTokenType

public int getTokenType()
Returns this token's type.
Returns:
one of the TOKEN_* constants.

toString

public java.lang.String toString()
Returns a string representation of this.
Overrides:
toString in class BasicTokenInfo
Returns:
a String.