Package: org.grails.gsp

## [Java] Class GroovyPageWritable

- org.grails.gsp.GroovyPageWritable

- All Implemented Interfaces and Traits:
    groovy.lang.Writable

      public class GroovyPageWritable
      extends java.lang.Object

  Writes itself to the specified writer, typically the response writer.

  Authors:
    Graeme Rocher
    Lari Hotari
  Since:
    0.5

- - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyPageWritable (GroovyPageMetaInfo metaInfo, OutputContextLookup outputContextLookup, boolean allowSettingContentType)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected void` | `doCleanUp(OutputContext outputContext, java.io.Writer out)`
    `protected java.io.Writer` | `doWriteTo(OutputContext outputContext, java.io.Writer out)`
    `boolean` | `isShowSource()`
    `void` | `setBinding(java.util.Map binding)` This sets any additional variables that need to be placed in the Binding of the GSP page.
    `void` | `setShowSource(boolean showSource)`
    `protected void` | `writeGroovySourceToResponse(GroovyPageMetaInfo info, java.io.Writer out)` Writes the Groovy source code attached to the given info object to the response, prefixing each line with its line number.
    `protected void` | `writeInputStreamToResponse(java.io.InputStream in, java.io.Writer out)` Copy all of input to output.
    `java.io.Writer` | `writeTo(java.io.Writer out)` Writes the template to the specified Writer

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### public GroovyPageWritable(GroovyPageMetaInfo metaInfo, OutputContextLookup outputContextLookup, boolean allowSettingContentType)

  - ### Method Detail

    - #### protected void doCleanUp(OutputContext outputContext, java.io.Writer out)

    - #### protected java.io.Writer doWriteTo(OutputContext outputContext, java.io.Writer out)

    - #### public boolean isShowSource()

    - #### @java.lang.SuppressWarnings("rawtypes") public void setBinding(java.util.Map binding)

      This sets any additional variables that need to be placed in the Binding of the GSP page.

      Parameters:
        `binding` - The additional variables

    - #### public void setShowSource(boolean showSource)

    - #### protected void writeGroovySourceToResponse(GroovyPageMetaInfo info, java.io.Writer out)

      Writes the Groovy source code attached to the given info object to the response, prefixing each line with its line number. The line numbers make it easier to match line numbers in exceptions to the generated source.

      throws:
        IOException If there is either a problem with the input stream for the Groovy source, or the writer.
      Parameters:
        `info` - The meta info for the GSP page that we want to write the generated source for.
        `out` - The writer to send the source to.

    - #### protected void writeInputStreamToResponse(java.io.InputStream in, java.io.Writer out)

      Copy all of input to output.

      throws:
        IOException When an error occurs writing to the response Writer
      Parameters:
        `in` - The input stream to writeInputStreamToResponse from
        `out` - The output to write to

    - #### public java.io.Writer writeTo(java.io.Writer out)

      Writes the template to the specified Writer

      throws:
        IOException
      Parameters:
        `out` - The Writer to write to, normally the HttpServletResponse
      Returns:
        Returns the passed Writer