Class GroovyTemplate

    • Constructor Detail

      • GroovyTemplate

        public GroovyTemplate​(java.lang.String name,
                              java.lang.String source)
      • GroovyTemplate

        public GroovyTemplate​(java.lang.String source)
    • Method Detail

      • registerFormatter

        public static <T> void registerFormatter​(java.lang.String format,
                                                 SafeFormatter formatter)
      • setUpCompilerConfiguration

        protected org.codehaus.groovy.control.CompilerConfiguration setUpCompilerConfiguration()
      • onCompileEnd

        protected void onCompileEnd()
      • compile

        public void compile()
        Specified by:
        compile in class Template
      • render

        public java.lang.String render​(java.util.Map<java.lang.String,​java.lang.Object> args)
        Description copied from class: Template
        Starts the rendering process without modifying the args-map
        Overrides:
        render in class Template
        Parameters:
        args - map containing data binding info
        Returns:
        the result of the complete rendering
      • setUpBindingVariables

        protected groovy.lang.Binding setUpBindingVariables​(java.util.Map<java.lang.String,​java.lang.Object> args)
      • internalRender

        protected java.lang.String internalRender​(java.util.Map<java.lang.String,​java.lang.Object> args)
        Description copied from class: Template
        The internal rendering method - When one template calls another template, this method is used. The input args-map is constantly being modified, as different templates "communicate" with each other by storing info in the map
        Specified by:
        internalRender in class Template
        Parameters:
        args - List of arguments use in render
        Returns:
        The template result as string
      • cleanStackTrace

        protected java.lang.Throwable cleanStackTrace​(java.lang.Throwable e)
        Specified by:
        cleanStackTrace in class BaseTemplate
      • isSimpleParam

        protected static boolean isSimpleParam​(java.lang.Class type)