Class ThriftTokenizer
- java.lang.Object
-
- java.io.Reader
-
- net.morimekta.util.io.LineBufferedReader
-
- net.morimekta.providence.serializer.pretty.Tokenizer
-
- net.morimekta.providence.reflect.parser.internal.ThriftTokenizer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class ThriftTokenizer extends net.morimekta.providence.serializer.pretty.Tokenizer
Specialization of the 'pretty' tokenizer to make it handle some special cases only applicable when parsing thrift files, but not allowed in pretty format or config files.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
kBlockCommentEnd
static java.lang.String
kBlockCommentStart
static java.lang.String
kConst
static java.lang.String
kEnum
static java.lang.String
kException
static java.lang.String
kExtends
static java.lang.String
kInclude
static java.lang.String
kLineCommentStart
static java.lang.String
kNamespace
static java.lang.String
kOneway
static java.lang.String
kOptional
static java.lang.String
kRequired
static java.lang.String
kService
static java.lang.String
kStruct
static java.lang.String
kThrows
static java.lang.String
kTypedef
static java.lang.String
kUnion
static java.lang.String
kVoid
-
Fields inherited from class net.morimekta.providence.serializer.pretty.Tokenizer
DEFAULT_BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description ThriftTokenizer(java.io.InputStream in)
ThriftTokenizer(java.io.Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected net.morimekta.providence.serializer.pretty.TokenizerException
failure(java.lang.String format, java.lang.Object... params)
protected net.morimekta.providence.serializer.pretty.Token
nextSymbol()
java.lang.String
parseDocBlock()
net.morimekta.providence.serializer.pretty.Token
parseValue()
-
Methods inherited from class net.morimekta.providence.serializer.pretty.Tokenizer
eof, expect, expect, expectIdentifier, expectInteger, expectLiteral, expectSymbol, failure, failure, getLastToken, hasNext, next, peek, peek, readBinary
-
Methods inherited from class net.morimekta.util.io.LineBufferedReader
close, getLine, getLineNo, getLinePos, getRemainingLines, getRestOfLine, maybeConsolidateBuffer, read, read, readNextChar
-
-
-
-
Field Detail
-
kNamespace
public static final java.lang.String kNamespace
- See Also:
- Constant Field Values
-
kInclude
public static final java.lang.String kInclude
- See Also:
- Constant Field Values
-
kTypedef
public static final java.lang.String kTypedef
- See Also:
- Constant Field Values
-
kEnum
public static final java.lang.String kEnum
- See Also:
- Constant Field Values
-
kStruct
public static final java.lang.String kStruct
- See Also:
- Constant Field Values
-
kUnion
public static final java.lang.String kUnion
- See Also:
- Constant Field Values
-
kException
public static final java.lang.String kException
- See Also:
- Constant Field Values
-
kConst
public static final java.lang.String kConst
- See Also:
- Constant Field Values
-
kService
public static final java.lang.String kService
- See Also:
- Constant Field Values
-
kExtends
public static final java.lang.String kExtends
- See Also:
- Constant Field Values
-
kVoid
public static final java.lang.String kVoid
- See Also:
- Constant Field Values
-
kOneway
public static final java.lang.String kOneway
- See Also:
- Constant Field Values
-
kThrows
public static final java.lang.String kThrows
- See Also:
- Constant Field Values
-
kRequired
public static final java.lang.String kRequired
- See Also:
- Constant Field Values
-
kOptional
public static final java.lang.String kOptional
- See Also:
- Constant Field Values
-
kLineCommentStart
public static final java.lang.String kLineCommentStart
- See Also:
- Constant Field Values
-
kBlockCommentStart
public static final java.lang.String kBlockCommentStart
- See Also:
- Constant Field Values
-
kBlockCommentEnd
public static final java.lang.String kBlockCommentEnd
- See Also:
- Constant Field Values
-
-
Method Detail
-
nextSymbol
@Nonnull protected net.morimekta.providence.serializer.pretty.Token nextSymbol() throws java.io.IOException
- Overrides:
nextSymbol
in classnet.morimekta.providence.serializer.pretty.Tokenizer
- Throws:
java.io.IOException
-
parseDocBlock
public java.lang.String parseDocBlock() throws java.io.IOException
- Throws:
java.io.IOException
-
parseValue
public net.morimekta.providence.serializer.pretty.Token parseValue() throws java.io.IOException
- Throws:
java.io.IOException
-
failure
@Nonnull protected net.morimekta.providence.serializer.pretty.TokenizerException failure(java.lang.String format, java.lang.Object... params)
- Overrides:
failure
in classnet.morimekta.providence.serializer.pretty.Tokenizer
-
-