Class LookaheadTokenFilter<T extends LookaheadTokenFilter.Position>

    • Constructor Detail

      • LookaheadTokenFilter

        protected LookaheadTokenFilter​(TokenStream input)
    • Method Detail

      • insertToken

        protected void insertToken()
                            throws IOException
        Call this only from within afterPosition, to insert a new token. After calling this you should set any necessary token you need.
        Throws:
        IOException
      • afterPosition

        protected void afterPosition()
                              throws IOException
        This is called when all input tokens leaving a given position have been returned. Override this and call insertToken and then set whichever token's attributes you want, if you want to inject a token starting from this position.
        Throws:
        IOException
      • newPosition

        protected abstract T newPosition()
      • peekToken

        protected boolean peekToken()
                             throws IOException
        Returns true if there is a new token.
        Throws:
        IOException
      • nextToken

        protected boolean nextToken()
                             throws IOException
        Call this when you are done looking ahead; it will set the next token to return. Return the boolean back to the caller.
        Throws:
        IOException