Class LexerImpl

java.lang.Object
io.pebbletemplates.pebble.lexer.LexerImpl
All Implemented Interfaces:
Lexer

public final class LexerImpl extends Object implements Lexer
This class reads the template input and builds single items out of it.

This class is not thread safe.

  • Constructor Details

    • LexerImpl

      public LexerImpl(Syntax syntax, Collection<UnaryOperator> unaryOperators, Collection<BinaryOperator> binaryOperators)
      Constructor
      Parameters:
      syntax - The primary syntax
      unaryOperators - The available unary operators
      binaryOperators - The available binary operators
  • Method Details

    • tokenize

      public TokenStream tokenize(Reader reader, String name)
      This is the main method used to tokenize the raw contents of a template.
      Specified by:
      tokenize in interface Lexer
      Parameters:
      reader - The reader provided from the Loader
      name - The name of the template (used for meaningful error messages)