Class StringTemplate

java.lang.Object
com.avoka.core.util.StringTemplate

public class StringTemplate extends Object
Provides a StringTemplate which utilizes the Velocity Engine.
  • Field Details

  • Constructor Details

    • StringTemplate

      public StringTemplate(String content)
      Create a template with the given content.
      Parameters:
      content - the template content
    • StringTemplate

      public StringTemplate(String content, jakarta.servlet.ServletContext servletContext)
      Create a template with the given content.
      Parameters:
      content - the template content
      servletContext - the applications servlet context
  • Method Details

    • merge

      public String merge(Map model)
      Merge the given model data with the template.
      Parameters:
      model - the model data to merge
      Returns:
      the rendered template merged with the model
    • merge

      public String merge(String key, Object value)
      Merge the given model key name and value with the template.
      Parameters:
      key - the model key name
      value - the model value
      Returns:
      the rendered template merged with the model
    • getTemplateEngine

      protected org.apache.velocity.app.VelocityEngine getTemplateEngine()