Class 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class net.morimekta.providence.serializer.pretty.Tokenizer

        net.morimekta.providence.serializer.pretty.Tokenizer.TokenValidator
    • 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
      • Fields inherited from class net.morimekta.util.io.LineBufferedReader

        buffer, bufferLimit, bufferLineEnd, bufferOffset, lastChar, lineNo, linePos, preLoaded, reader
      • Fields inherited from class java.io.Reader

        lock
    • 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
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThriftTokenizer

        public ThriftTokenizer​(java.io.InputStream in)
      • ThriftTokenizer

        public ThriftTokenizer​(java.io.Reader reader)
    • Method Detail

      • nextSymbol

        @Nonnull
        protected net.morimekta.providence.serializer.pretty.Token nextSymbol()
                                                                       throws java.io.IOException
        Overrides:
        nextSymbol in class net.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 class net.morimekta.providence.serializer.pretty.Tokenizer