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.TokenizerSpecialization 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.StringkBlockCommentEndstatic java.lang.StringkBlockCommentStartstatic java.lang.StringkConststatic java.lang.StringkEnumstatic java.lang.StringkExceptionstatic java.lang.StringkExtendsstatic java.lang.StringkIncludestatic java.lang.StringkLineCommentStartstatic java.lang.StringkNamespacestatic java.lang.StringkOnewaystatic java.lang.StringkOptionalstatic java.lang.StringkRequiredstatic java.lang.StringkServicestatic java.lang.StringkStructstatic java.lang.StringkThrowsstatic java.lang.StringkTypedefstatic java.lang.StringkUnionstatic java.lang.StringkVoid-
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.TokenizerExceptionfailure(java.lang.String format, java.lang.Object... params)protected net.morimekta.providence.serializer.pretty.TokennextSymbol()java.lang.StringparseDocBlock()net.morimekta.providence.serializer.pretty.TokenparseValue()-
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:
nextSymbolin 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:
failurein classnet.morimekta.providence.serializer.pretty.Tokenizer
-
-