All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pebbletemplates.pebble.extension.Extension Maven / Gradle / Ivy

The newest version!
/*
 * This file is part of Pebble.
 *
 * Copyright (c) 2014 by Mitchell Bösecke
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
package io.pebbletemplates.pebble.extension;

import io.pebbletemplates.pebble.attributes.AttributeResolver;
import io.pebbletemplates.pebble.operator.BinaryOperator;
import io.pebbletemplates.pebble.operator.UnaryOperator;
import io.pebbletemplates.pebble.tokenParser.TokenParser;
import java.util.List;
import java.util.Map;

public interface Extension {

  /**
   * Use this method to provide custom filters.
   *
   * @return A list of filters. It is okay to return null.
   */
  Map getFilters();

  /**
   * Use this method to provide custom tests.
   *
   * @return A list of tests. It is okay to return null.
   */
  Map getTests();

  /**
   * Use this method to provide custom functions.
   *
   * @return A list of functions. It is okay to return null.
   */
  Map getFunctions();

  /**
   * Use this method to provide custom tags.
   *
   * A TokenParser is used to parse a stream of tokens into Nodes which are then responsible for
   * compiling themselves into Java.
   *
   * @return A list of TokenParsers. It is okay to return null.
   */
  List getTokenParsers();

  /**
   * Use this method to provide custom binary operators.
   *
   * @return A list of Operators. It is okay to return null;
   */
  List getBinaryOperators();

  /**
   * Use this method to provide custom unary operators.
   *
   * @return A list of Operators. It is okay to return null;
   */
  List getUnaryOperators();

  /**
   * Use this method to provide variables available to all templates
   *
   * @return Map of global variables available to all templates
   */
  Map getGlobalVariables();

  /**
   * Node visitors will travel the AST tree during the compilation phase.
   *
   * @return a list of node visitors
   */
  List getNodeVisitors();

  /**
   * AttributeResolver will resolve instance attributes
   *
   * @return a list of attribute resolver
   */
  List getAttributeResolver();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy