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 charkFieldValueSepstatic charkGenericEndstatic charkGenericStartstatic charkKeyValueSepstatic charkLineSep1static charkLineSep2static charkListEndstatic charkListStartstatic charkMessageEndstatic charkMessageStartstatic charkParamsEndstatic charkParamsStart
-
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 booleanisDoubleQualifiedIdentifier()booleanisEnumValueId()booleanisFieldId()booleanisIdentifier()booleanisInteger()booleanisQualifiedIdentifier()booleanisReal()booleanisReferenceIdentifier()booleanisSymbol(char symbol)java.lang.StringparseDocumentation()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:
isSymbolin 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()
-
-