Class DefaultStreamTokenizer

    • Field Detail

      • log

        protected static final org.slf4j.Logger log
    • Constructor Detail

      • DefaultStreamTokenizer

        public DefaultStreamTokenizer​(InputStream is)
    • Method Detail

      • hasMoreTokens

        public boolean hasMoreTokens()
        Checks, if any prebuffered tokens left, otherswise checks underlying stream
        Specified by:
        hasMoreTokens in interface Tokenizer
        Returns:
      • countTokens

        public int countTokens()
        Returns number of tokens PLEASE NOTE: this method effectively preloads all tokens. So use it with caution, since on large streams it will consume big amount of memory
        Specified by:
        countTokens in interface Tokenizer
        Returns:
      • nextToken

        public String nextToken()
        This method returns next token from prebuffered list of tokens or underlying InputStream
        Specified by:
        nextToken in interface Tokenizer
        Returns:
        next token as String
      • getTokens

        public List<String> getTokens()
        Returns all tokens as list of Strings
        Specified by:
        getTokens in interface Tokenizer
        Returns:
        List of tokens
      • setTokenPreProcessor

        public void setTokenPreProcessor​(TokenPreProcess tokenPreProcessor)
        Description copied from interface: Tokenizer
        Set the token pre process
        Specified by:
        setTokenPreProcessor in interface Tokenizer
        Parameters:
        tokenPreProcessor - the token pre processor to set