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 Summary
Modifier and TypeMethodDescriptionvoid
close()
This method does nothing.Get the line break used in line-oriented output.void
print
(groovy.lang.Writable p_writable) Write a writable Groovy object.void
void
println()
void
println
(groovy.lang.Writable p_writable) Write a writable Groovy object, and a line break.void
void
setLineBreak
(String p_strLineBreak) Set the line break to be used in line-oriented output.void
SetCR LF
as the line break to be used in line-oriented output.void
SetLF
as the line break to be used in line-oriented output.void
write
(groovy.lang.Writable p_writable) Write a writable Groovy object.writeJSON
(boolean p_bValue) Write aboolean
.writeJSON
(double p_dblValue) Write andouble
.writeJSON
(float p_fltValue) Write anfloat
.writeJSON
(int p_iValue) Write anint
.writeJSON
(long p_lValue) Write along
.writeJSON
(CharSequence p_chseq) Write a character sequence.Write an iterable.Write an object.Write a date.Write an iterator.Write map.Write a colon:
.Write a comma,
.Write a closing square bracket]
.Write a closing curly bracket}
.writeJSONEscape
(CharSequence p_chseq) Write a JSON-escaped character sequence.writeJSONEscape
(CharSequence p_chseq, int p_iStart, int p_iEnd) Write a JSON-escaped character subsequence.writeJSONNamedObject
(Object p_object, String p_strName, List<? extends CharSequence> p_properties) Write a JSON named object with the given object's bean properties.writeJSONPair
(String p_strName, Object p_value) Write a name-value pair, e.g.writeJSONPairs
(Object p_object, List<? extends CharSequence> p_properties) Write name-value pairs ("name":"value",
...) representing the given object's bean properties.writeJSONPairs
(Map<String, Object> p_map) Write the name-value pairs ("name":"value",
...) of the given map.Write a double quote"
.Write an opening square bracket[
.Write an opening curly bracket{
.Methods inherited from class de.uplanet.io.AbstractDelegatingPrintWriter
append, append, append, checkError, flush, format, format, isWritten, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, write, write, write, write, write
Methods inherited from class java.io.Writer
nullWriter
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.uplanet.lucy.server.scripting.groovy.IPrintDelegate
print, println
-
Method Details
-
getLineBreak
Get the line break used in line-oriented output.- Returns:
- The line break used.
-
setLineBreak
Set the line break to be used in line-oriented output.- Parameters:
p_strLineBreak
- The line break to be used.
-
setLineBreakLF
public void setLineBreakLF()SetLF
as the line break to be used in line-oriented output. -
setLineBreakCRLF
public void setLineBreakCRLF()SetCR LF
as the line break to be used in line-oriented output. -
write
Write a writable Groovy object.- Parameters:
p_writable
- The object to be written.- Throws:
IOException
- If an I/O error occurred.
-
print
Write a writable Groovy object.- Parameters:
p_writable
- The object to be written.- Throws:
IOException
- If an I/O error occurred.
-
println
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter>
-
println
public void println()- Specified by:
println
in interfacede.uplanet.lucy.server.scripting.groovy.IPrintDelegate
- Overrides:
println
in classAbstractDelegatingPrintWriter<GroovyHttpServletResponseWriter>
-
print
-
println
-
writeJSONStartObject
Write an opening curly bracket{
.- Returns:
- This object.
-
writeJSONEndObject
Write a closing curly bracket}
.- Returns:
- This object.
-
writeJSONStartArray
Write an opening square bracket[
.- Returns:
- This object.
-
writeJSONEndArray
Write a closing square bracket]
.- Returns:
- This object.
-
writeJSONQuote
Write a double quote"
.- Returns:
- This object.
-
writeJSONComma
Write a comma,
.- Returns:
- This object.
-
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
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
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 isnull
.
-
writeJSON
Write a character sequence. The method mimics theJSON.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
Write aboolean
. The method mimics theJSON.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
Write anint
. The method mimics theJSON.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
Write along
. The method mimics theJSON.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
Write anfloat
. The method mimics theJSON.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
Write andouble
. The method mimics theJSON.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
Write a date. The method mimics theJSON.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
Write an object. The method mimics theJSON.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
Write map.- Parameters:
p_map
- The map to be written.- Returns:
- This object.
- Throws:
IOException
- If an I/O error occurred.
-
writeJSON
Write an iterable.- Parameters:
p_iterable
- The iterable to be written.- Returns:
- This object
- Throws:
IOException
- If an I/O error occurred.
-
writeJSON
Write an iterator.- Parameters:
p_iterator
- The iterator to be written.- Returns:
- This object
- Throws:
IOException
- If an I/O error occurred.
-