Class GroovyHttpServletResponseWriter

java.lang.Object
java.io.Writer
java.io.PrintWriter
de.uplanet.io.AbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter>
de.uplanet.lucy.server.scripting.groovy.servlet.GroovyHttpServletResponseWriter
All Implemented Interfaces:
de.uplanet.lucy.server.scripting.groovy.IPrintDelegate, Closeable, Flushable, Appendable, AutoCloseable

public abstract class GroovyHttpServletResponseWriter extends AbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter> implements de.uplanet.lucy.server.scripting.groovy.IPrintDelegate
Since:
Intrexx 10.10.
  • Method Details

    • getLineBreak

      public String getLineBreak()
      Get the line break used in line-oriented output.
      Returns:
      The line break used.
    • setLineBreak

      public void setLineBreak(String p_strLineBreak)
      Set the line break to be used in line-oriented output.
      Parameters:
      p_strLineBreak - The line break to be used.
    • setLineBreakLF

      public void setLineBreakLF()
      Set LF as the line break to be used in line-oriented output.
    • setLineBreakCRLF

      public void setLineBreakCRLF()
      Set CR LF as the line break to be used in line-oriented output.
    • write

      public void write(groovy.lang.Writable p_writable) throws IOException
      Write a writable Groovy object.
      Parameters:
      p_writable - The object to be written.
      Throws:
      IOException - If an I/O error occurred.
    • print

      public void print(groovy.lang.Writable p_writable) throws IOException
      Write a writable Groovy object.
      Parameters:
      p_writable - The object to be written.
      Throws:
      IOException - If an I/O error occurred.
    • println

      public void println(groovy.lang.Writable p_writable) throws IOException
      Write a writable Groovy object, and a line break.
      Parameters:
      p_writable - The object to be written.
      Throws:
      IOException - If an I/O error occurred.
    • close

      public void close()
      This method does nothing.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter>
    • println

      public void println()
      Specified by:
      println in interface de.uplanet.lucy.server.scripting.groovy.IPrintDelegate
      Overrides:
      println in class AbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter>
    • print

      public void print(Date p_dt)
    • println

      public void println(Date p_dt)
    • writeJSONStartObject

      public GroovyHttpServletResponseWriter writeJSONStartObject()
      Write an opening curly bracket {.
      Returns:
      This object.
    • writeJSONEndObject

      public GroovyHttpServletResponseWriter writeJSONEndObject()
      Write a closing curly bracket }.
      Returns:
      This object.
    • writeJSONStartArray

      public GroovyHttpServletResponseWriter writeJSONStartArray()
      Write an opening square bracket [.
      Returns:
      This object.
    • writeJSONEndArray

      public GroovyHttpServletResponseWriter writeJSONEndArray()
      Write a closing square bracket ].
      Returns:
      This object.
    • writeJSONQuote

      public GroovyHttpServletResponseWriter writeJSONQuote()
      Write a double quote ".
      Returns:
      This object.
    • writeJSONComma

      public GroovyHttpServletResponseWriter writeJSONComma()
      Write a comma ,.
      Returns:
      This object.
    • writeJSONColon

      public GroovyHttpServletResponseWriter writeJSONColon()
      Write a colon :.
      Returns:
      This object.
    • writeJSONPair

      public GroovyHttpServletResponseWriter writeJSONPair(String p_strName, Object p_value) throws IOException
      Write a name-value pair, e.g. "name":"value".
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSONPairs

      public GroovyHttpServletResponseWriter writeJSONPairs(Object p_object, List<? extends CharSequence> p_properties) throws IOException
      Write name-value pairs ("name":"value",...) representing the given object's bean properties.
      Parameters:
      p_object - The object.
      p_properties - A list of bean properties that should be written as name-value pairs.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSONPairs

      public GroovyHttpServletResponseWriter writeJSONPairs(Map<String,Object> p_map) throws IOException
      Write the name-value pairs ("name":"value",...) of the given map.
      Parameters:
      p_map - A map containing the pairs.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSONNamedObject

      public GroovyHttpServletResponseWriter writeJSONNamedObject(Object p_object, String p_strName, List<? extends CharSequence> p_properties) throws IOException
      Write a JSON named object with the given object's bean properties.
      Parameters:
      p_object - The object.
      p_strName - The name of the object.
      p_properties - A list of bean properties that should be written as name-value pairs.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSONEscape

      public GroovyHttpServletResponseWriter writeJSONEscape(CharSequence p_chseq) throws IOException
      Write a JSON-escaped character sequence.
      Parameters:
      p_chseq - The character sequence to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSONEscape

      public GroovyHttpServletResponseWriter writeJSONEscape(CharSequence p_chseq, int p_iStart, int p_iEnd) throws IOException
      Write a JSON-escaped character subsequence.
      Parameters:
      p_chseq - The character sequence to be written.
      p_iStart - The index of the first character in the subsequence.
      p_iEnd - The index of the character following the last character in the subsequence.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
      IllegalArgumentException - If the given character sequence is null.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(CharSequence p_chseq) throws IOException
      Write a character sequence. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_chseq - The character sequence to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(boolean p_bValue) throws IOException
      Write a boolean. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_bValue - The value to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(int p_iValue) throws IOException
      Write an int. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_iValue - The value to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(long p_lValue) throws IOException
      Write a long. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_lValue - The value to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(float p_fltValue) throws IOException
      Write an float. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_fltValue - The value to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(double p_dblValue) throws IOException
      Write an double. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_dblValue - The value to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(Date p_dt) throws IOException
      Write a date. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_dt - The date to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(Object p_obj) throws IOException
      Write an object. The method mimics the JSON.stringify function as defined in the ECMAScript Language Scecification, 5.1 edition.
      Parameters:
      p_obj - The object to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(Map<?,?> p_map) throws IOException
      Write map.
      Parameters:
      p_map - The map to be written.
      Returns:
      This object.
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(Iterable<?> p_iterable) throws IOException
      Write an iterable.
      Parameters:
      p_iterable - The iterable to be written.
      Returns:
      This object
      Throws:
      IOException - If an I/O error occurred.
    • writeJSON

      public GroovyHttpServletResponseWriter writeJSON(Iterator<?> p_iterator) throws IOException
      Write an iterator.
      Parameters:
      p_iterator - The iterator to be written.
      Returns:
      This object
      Throws:
      IOException - If an I/O error occurred.