Package liqp

Class TemplateParser

java.lang.Object
liqp.TemplateParser

public class TemplateParser extends Object
The new main entrance point of this library.
  • Field Details

    • DEFAULT_LOCALE

      public static final Locale DEFAULT_LOCALE
    • DEFAULT_FLAVOR

      public static final Flavor DEFAULT_FLAVOR
    • DEFAULT

      public static final TemplateParser DEFAULT
      Returns a TemplateParser configured with all default settings for "Liqp" flavor.
    • DEFAULT_JEKYLL

      public static final TemplateParser DEFAULT_JEKYLL
    • flavor

      public final Flavor flavor
    • stripSpacesAroundTags

      public final boolean stripSpacesAroundTags
    • stripSingleLine

      public final boolean stripSingleLine
    • mapper

      public final com.fasterxml.jackson.databind.ObjectMapper mapper
    • insertions

      public final Insertions insertions
    • filters

      public final Filters filters
    • evaluateInOutputTag

      public final boolean evaluateInOutputTag
    • strictTypedExpressions

      public final boolean strictTypedExpressions
    • errorMode

      public final TemplateParser.ErrorMode errorMode
    • liquidStyleInclude

      public final boolean liquidStyleInclude
    • liquidStyleWhere

      public final boolean liquidStyleWhere
    • strictVariables

      public final boolean strictVariables
      The same as template.render!({}, strict_variables: true) in ruby
    • showExceptionsFromInclude

      public final boolean showExceptionsFromInclude
      This field doesn't have equivalent in ruby.
    • evaluateMode

      public final TemplateParser.EvaluateMode evaluateMode
    • locale

      public final Locale locale
    • defaultTimeZone

      public final ZoneId defaultTimeZone
      Never null, if empty - system default timezone is used.
    • nameResolver

      public final NameResolver nameResolver
  • Method Details

    • evaluate

      public Map<String,Object> evaluate(com.fasterxml.jackson.databind.ObjectMapper mapper, Map<String,Object> variables)
      If template context is not available yet - it's ok to create new. This function don't need access to local context variables, as it operates with parameters.
    • evaluate

      public LiquidSupport evaluate(Object variable)
      If template context is not available yet - it's ok to create new. This function don't need access to local context variables, as it operates with parameters.
    • parse

      public Template parse(Path path) throws IOException
      Throws:
      IOException
    • parse

      public Template parse(File file) throws IOException
      Throws:
      IOException
    • parse

      public Template parse(String input)
    • parse

      public Template parse(InputStream input) throws IOException
      Throws:
      IOException
    • parse

      public Template parse(Reader reader) throws IOException
      Throws:
      IOException
    • parse

      public Template parse(org.antlr.v4.runtime.CharStream input)
    • getLimitMaxIterations

      public int getLimitMaxIterations()
    • getLimitMaxSizeRenderedString

      public int getLimitMaxSizeRenderedString()
    • getLimitMaxRenderTimeMillis

      public long getLimitMaxRenderTimeMillis()
    • getLimitMaxTemplateSizeBytes

      public long getLimitMaxTemplateSizeBytes()
    • isRenderTimeLimited

      public Boolean isRenderTimeLimited()
    • getErrorMode

      public TemplateParser.ErrorMode getErrorMode()
    • isStripSingleLine

      public boolean isStripSingleLine()
    • isStripSpacesAroundTags

      public boolean isStripSpacesAroundTags()
    • getMapper

      public com.fasterxml.jackson.databind.ObjectMapper getMapper()
    • getRenderTransformer

      public RenderTransformer getRenderTransformer()
    • getEnvironmentMapConfigurator

      public Consumer<Map<String,Object>> getEnvironmentMapConfigurator()
    • getDateParser

      public BasicDateParser getDateParser()