Package groovy.text

Class TemplateEngine

    • Constructor Summary

      Constructors 
      Constructor Description
      TemplateEngine()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      Template createTemplate​(java.io.File file)
      Creates a template from the File contents.
      Template createTemplate​(java.io.File file, java.nio.charset.Charset cs)
      Creates a template from the File contents using the given charset encoding.
      abstract Template createTemplate​(java.io.Reader reader)
      Creates a template by reading content from the Reader.
      Template createTemplate​(java.lang.String templateText)
      Creates a template from the String contents.
      Template createTemplate​(java.net.URL url)
      Creates a template from the content found at the URL using the default encoding.
      Template createTemplate​(java.net.URL url, java.nio.charset.Charset cs)
      Creates a template from the content found at the URL using the given charset encoding.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TemplateEngine

        public TemplateEngine()
    • Method Detail

      • createTemplate

        public abstract Template createTemplate​(java.io.Reader reader)
                                         throws org.codehaus.groovy.control.CompilationFailedException,
                                                java.lang.ClassNotFoundException,
                                                java.io.IOException
        Creates a template by reading content from the Reader.
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException
      • createTemplate

        public Template createTemplate​(java.lang.String templateText)
                                throws org.codehaus.groovy.control.CompilationFailedException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
        Creates a template from the String contents.
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException
      • createTemplate

        public Template createTemplate​(java.io.File file)
                                throws org.codehaus.groovy.control.CompilationFailedException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
        Creates a template from the File contents. If the encoding for the file can be determined, that encoding will be used, otherwise the default encoding will be used. Consider using createTemplate(File, Charset) if you need to explicitly set the encoding.
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException
      • createTemplate

        public Template createTemplate​(java.io.File file,
                                       java.nio.charset.Charset cs)
                                throws org.codehaus.groovy.control.CompilationFailedException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
        Creates a template from the File contents using the given charset encoding.
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException
      • createTemplate

        public Template createTemplate​(java.net.URL url)
                                throws org.codehaus.groovy.control.CompilationFailedException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
        Creates a template from the content found at the URL using the default encoding. Please consider using createTemplate(URL, Charset).
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException
      • createTemplate

        public Template createTemplate​(java.net.URL url,
                                       java.nio.charset.Charset cs)
                                throws org.codehaus.groovy.control.CompilationFailedException,
                                       java.lang.ClassNotFoundException,
                                       java.io.IOException
        Creates a template from the content found at the URL using the given charset encoding.
        Throws:
        org.codehaus.groovy.control.CompilationFailedException
        java.lang.ClassNotFoundException
        java.io.IOException