com.xpn.xwiki.render.groovy
Class GroovyTemplateEngine.SimpleTemplate

java.lang.Object
  extended by com.xpn.xwiki.render.groovy.GroovyTemplateEngine.SimpleTemplate
All Implemented Interfaces:
groovy.text.Template
Enclosing class:
GroovyTemplateEngine

private static class GroovyTemplateEngine.SimpleTemplate
extends java.lang.Object
implements groovy.text.Template


Field Summary
private  groovy.lang.Binding binding
           
private  java.util.Map map
           
private  groovy.lang.Script script
           
 
Constructor Summary
private GroovyTemplateEngine.SimpleTemplate()
           
 
Method Summary
private  void endScript(java.io.StringWriter sw)
           
 void finalize()
           
private  void groovyExpression(java.io.Reader reader, java.io.StringWriter sw)
          Closes the currently open write and writes out the following text as a GString expression until it reaches an end %>.
private  void groovySection(java.io.Reader reader, java.io.StringWriter sw)
          Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.
 groovy.lang.Writable make()
           
 groovy.lang.Writable make(java.util.Map map)
           
private  java.lang.String parse(java.io.Reader reader)
          Parse the text document looking for <% or <%= and then call out to the appropriate handler, otherwise copy the text directly into the script while escaping quotes.
 void setBinding(java.util.Map map)
          Set the binding for the template.
private  void startScript(java.io.StringWriter sw)
           
 java.lang.String toString()
          Convert the template and binding into a result String.
 java.io.Writer writeTo(java.io.Writer writer)
          Write the template document with the set binding applied to the writer.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

script

private groovy.lang.Script script

binding

private groovy.lang.Binding binding

map

private java.util.Map map
Constructor Detail

GroovyTemplateEngine.SimpleTemplate

private GroovyTemplateEngine.SimpleTemplate()
Method Detail

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

setBinding

public void setBinding(java.util.Map map)
Set the binding for the template. Keys will be converted to Strings.

See Also:
groovy.text.Template#setBinding(java.util.Map)

writeTo

public java.io.Writer writeTo(java.io.Writer writer)
                       throws java.io.IOException
Write the template document with the set binding applied to the writer.

Throws:
java.io.IOException
See Also:
Writable.writeTo(java.io.Writer)

toString

public java.lang.String toString()
Convert the template and binding into a result String.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

parse

private java.lang.String parse(java.io.Reader reader)
                        throws java.io.IOException
Parse the text document looking for <% or <%= and then call out to the appropriate handler, otherwise copy the text directly into the script while escaping quotes.

Parameters:
reader -
Returns:
Throws:
java.io.IOException

startScript

private void startScript(java.io.StringWriter sw)

endScript

private void endScript(java.io.StringWriter sw)

groovyExpression

private void groovyExpression(java.io.Reader reader,
                              java.io.StringWriter sw)
                       throws java.io.IOException
Closes the currently open write and writes out the following text as a GString expression until it reaches an end %>.

Parameters:
reader -
sw -
Throws:
java.io.IOException

groovySection

private void groovySection(java.io.Reader reader,
                           java.io.StringWriter sw)
                    throws java.io.IOException
Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.

Parameters:
reader -
sw -
Throws:
java.io.IOException

make

public groovy.lang.Writable make()
Specified by:
make in interface groovy.text.Template

make

public groovy.lang.Writable make(java.util.Map map)
Specified by:
make in interface groovy.text.Template


Copyright 2003 Ludovic Dubost