Class ThriftToken
- java.lang.Object
-
- net.morimekta.util.CharSlice
-
- net.morimekta.util.lexer.Token<ThriftTokenType>
-
- net.morimekta.providence.reflect.parser.ThriftToken
-
- All Implemented Interfaces:
java.lang.CharSequence
,java.lang.Comparable<net.morimekta.util.CharSlice>
,net.morimekta.util.Stringable
public class ThriftToken extends net.morimekta.util.lexer.Token<ThriftTokenType>
-
-
Field Summary
Fields Modifier and Type Field Description static char
kFieldValueSep
static char
kGenericEnd
static char
kGenericStart
static char
kKeyValueSep
static char
kLineSep1
static char
kLineSep2
static char
kListEnd
static char
kListStart
static char
kMessageEnd
static char
kMessageStart
static char
kParamsEnd
static char
kParamsStart
-
Constructor Summary
Constructors Constructor Description ThriftToken(char[] fb, int off, int len, ThriftTokenType type, int lineNo, int linePos)
Create a slice instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isDoubleQualifiedIdentifier()
boolean
isEnumValueId()
boolean
isFieldId()
boolean
isIdentifier()
boolean
isInteger()
boolean
isQualifiedIdentifier()
boolean
isReal()
boolean
isReferenceIdentifier()
boolean
isSymbol(char symbol)
java.lang.String
parseDocumentation()
Parse token content as documentation.-
Methods inherited from class net.morimekta.util.lexer.Token
decodeString, equals, hashCode, line, lineNo, linePos, type
-
Methods inherited from class net.morimekta.util.CharSlice
asString, charAt, compareTo, contains, contains, containsAny, length, offset, parseDouble, parseInteger, strEquals, strEquals, subSequence, substring, toString
-
-
-
-
Field Detail
-
kGenericStart
public static final char kGenericStart
- See Also:
- Constant Field Values
-
kGenericEnd
public static final char kGenericEnd
- See Also:
- Constant Field Values
-
kMessageStart
public static final char kMessageStart
- See Also:
- Constant Field Values
-
kMessageEnd
public static final char kMessageEnd
- See Also:
- Constant Field Values
-
kKeyValueSep
public static final char kKeyValueSep
- See Also:
- Constant Field Values
-
kFieldValueSep
public static final char kFieldValueSep
- See Also:
- Constant Field Values
-
kParamsStart
public static final char kParamsStart
- See Also:
- Constant Field Values
-
kParamsEnd
public static final char kParamsEnd
- See Also:
- Constant Field Values
-
kListStart
public static final char kListStart
- See Also:
- Constant Field Values
-
kListEnd
public static final char kListEnd
- See Also:
- Constant Field Values
-
kLineSep1
public static final char kLineSep1
- See Also:
- Constant Field Values
-
kLineSep2
public static final char kLineSep2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThriftToken
public ThriftToken(char[] fb, int off, int len, @Nonnull ThriftTokenType type, int lineNo, int linePos)
Create a slice instance. The slice is only meant to be internal state immutable, and not representing an immutable byte content.- Parameters:
fb
- The buffer to wrap.off
- The start offset to wrap.len
- The length to represent.type
- The token type represented.lineNo
- The current line number.linePos
- The current line position.
-
-
Method Detail
-
isSymbol
public boolean isSymbol(char symbol)
- Overrides:
isSymbol
in classnet.morimekta.util.lexer.Token<ThriftTokenType>
-
parseDocumentation
public java.lang.String parseDocumentation()
Parse token content as documentation.- Returns:
- The documentation string.
-
isFieldId
public boolean isFieldId()
-
isEnumValueId
public boolean isEnumValueId()
-
isInteger
public boolean isInteger()
-
isReal
public boolean isReal()
-
isIdentifier
public boolean isIdentifier()
-
isQualifiedIdentifier
public boolean isQualifiedIdentifier()
-
isDoubleQualifiedIdentifier
public boolean isDoubleQualifiedIdentifier()
-
isReferenceIdentifier
public boolean isReferenceIdentifier()
-
-