Interface EscapingStrategyPlugin

All Superinterfaces:
Plugin
All Known Implementing Classes:
JsonEscapingStrategy, NoneEscapingStrategy, XmlEscapingStrategy

public interface EscapingStrategyPlugin extends Plugin
Plugin that provides an EscapingStrategy to be used by Handlebars when replacing variables in a template. Please keep in mind that this strategy is applied to every variable and does not regard the context where the variable takes place in within the template.
  • Method Details

    • accepts

      boolean accepts(String fileExtension, EscapingStrategyContext pluginContext)
      Checks if the plugin can be applied to files with the given file extension.
      Parameters:
      fileExtension - File extension
      pluginContext - Plugin context
      Returns:
      true when the plugin can be applied to the given file.
    • escape

      CharSequence escape(CharSequence value, EscapingStrategyContext pluginContext)
      Escape the CharSequence.
      Parameters:
      value - the character sequence to be escaped.
      pluginContext - Plugin context
      Returns:
      the escaped character sequence.