org.codehaus.groovy.grails.web.sitemesh
Class GrailsRoutablePrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.codehaus.groovy.grails.web.util.GrailsPrintWriter
              extended by org.codehaus.groovy.grails.web.sitemesh.GrailsRoutablePrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class GrailsRoutablePrintWriter
extends GrailsPrintWriter


Nested Class Summary
static interface GrailsRoutablePrintWriter.DestinationFactory
          Factory to lazily instantiate the destination.
 
Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriter
allowUnwrappingOut, out, trouble
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
GrailsRoutablePrintWriter(GrailsRoutablePrintWriter.DestinationFactory factory)
           
 
Method Summary
 PrintWriter append(char c)
           
 PrintWriter append(CharSequence csq)
           
 PrintWriter append(CharSequence csq, int start, int end)
           
 boolean checkError()
          Flush the stream if it's not closed and check its error state.
 void close()
           
 void flush()
          Flush the stream.
 Writer getFinalTarget()
           
 Writer getOut()
           
 boolean isAllowUnwrappingOut()
          tell others if getOut() can be called to "unwrap" the actual target writer if the destination hasn't been activated, don't allow it.
 void print(boolean b)
          delegate methods, not synchronized
 void print(char c)
           
 void print(char[] s)
           
 void print(double d)
           
 void print(float f)
           
 void print(int i)
           
 void print(long l)
           
 void print(Object obj)
          Print an object.
 void print(String s)
          Print a string.
 void println()
           
 void println(boolean x)
           
 void println(char x)
           
 void println(char[] x)
           
 void println(double x)
           
 void println(float x)
           
 void println(int x)
           
 void println(long x)
           
 void println(Object x)
           
 void println(String x)
           
 void updateDestination(GrailsRoutablePrintWriter.DestinationFactory factory)
           
 void write(char[] buf)
           
 void write(char[] buf, int off, int len)
          Write a portion of an array of characters.
 void write(int c)
          Write a single character.
 void write(String s)
          Writes a string.
 void write(String s, int off, int len)
          Write a portion of a string.
 
Methods inherited from class org.codehaus.groovy.grails.web.util.GrailsPrintWriter
append, append, clone, handleIOException, isFinalTargetHere, isUsed, leftShift, leftShift, leftShift, plus, print, print, println, resetUsed, setFinalTargetHere, setUsed, write, write
 
Methods inherited from class java.io.PrintWriter
clearError, format, format, printf, printf, setError
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrailsRoutablePrintWriter

public GrailsRoutablePrintWriter(GrailsRoutablePrintWriter.DestinationFactory factory)
Method Detail

isAllowUnwrappingOut

public boolean isAllowUnwrappingOut()
tell others if getOut() can be called to "unwrap" the actual target writer if the destination hasn't been activated, don't allow it.

Overrides:
isAllowUnwrappingOut in class GrailsPrintWriter
See Also:
GrailsPrintWriter.isAllowUnwrappingOut()

getOut

public Writer getOut()
Overrides:
getOut in class GrailsPrintWriter

getFinalTarget

public Writer getFinalTarget()
Overrides:
getFinalTarget in class GrailsPrintWriter

updateDestination

public void updateDestination(GrailsRoutablePrintWriter.DestinationFactory factory)

close

public void close()
Specified by:
close in interface Closeable
Overrides:
close in class PrintWriter

println

public void println(Object x)
Overrides:
println in class GrailsPrintWriter

println

public void println(String x)
Overrides:
println in class GrailsPrintWriter

println

public void println(char[] x)
Overrides:
println in class GrailsPrintWriter

println

public void println(double x)
Overrides:
println in class GrailsPrintWriter

println

public void println(float x)
Overrides:
println in class GrailsPrintWriter

println

public void println(long x)
Overrides:
println in class GrailsPrintWriter

println

public void println(int x)
Overrides:
println in class GrailsPrintWriter

println

public void println(char x)
Overrides:
println in class GrailsPrintWriter

println

public void println(boolean x)
Overrides:
println in class GrailsPrintWriter

println

public void println()
Overrides:
println in class GrailsPrintWriter

print

public void print(Object obj)
Description copied from class: GrailsPrintWriter
Print an object. The string produced by the String.valueOf(Object) method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the GrailsPrintWriter.write(int) method.

Overrides:
print in class GrailsPrintWriter
Parameters:
obj - The Object to be printed
See Also:
Object.toString()

print

public void print(String s)
Description copied from class: GrailsPrintWriter
Print a string. If the argument is null then the string "" is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the GrailsPrintWriter.write(int) method.

Overrides:
print in class GrailsPrintWriter
Parameters:
s - The String to be printed

print

public void print(char[] s)
Overrides:
print in class GrailsPrintWriter

print

public void print(double d)
Overrides:
print in class GrailsPrintWriter

print

public void print(float f)
Overrides:
print in class GrailsPrintWriter

print

public void print(long l)
Overrides:
print in class GrailsPrintWriter

print

public void print(int i)
Overrides:
print in class GrailsPrintWriter

print

public void print(char c)
Overrides:
print in class GrailsPrintWriter

print

public void print(boolean b)
Description copied from class: GrailsPrintWriter
delegate methods, not synchronized

Overrides:
print in class GrailsPrintWriter

write

public void write(String s)
Description copied from class: GrailsPrintWriter
Writes a string. If the argument is null then the string "" is printed.

Overrides:
write in class GrailsPrintWriter
Parameters:
s - The String to be printed

write

public void write(String s,
                  int off,
                  int len)
Description copied from class: GrailsPrintWriter
Write a portion of a string.

Overrides:
write in class GrailsPrintWriter
Parameters:
s - A String
off - Offset from which to start writing characters
len - Number of characters to write

write

public void write(char[] buf)
Overrides:
write in class GrailsPrintWriter

write

public void write(char[] buf,
                  int off,
                  int len)
Description copied from class: GrailsPrintWriter
Write a portion of an array of characters.

Overrides:
write in class GrailsPrintWriter
Parameters:
buf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write

write

public void write(int c)
Description copied from class: GrailsPrintWriter
Write a single character.

Overrides:
write in class GrailsPrintWriter
Parameters:
c - int specifying a character to be written.

checkError

public boolean checkError()
Description copied from class: GrailsPrintWriter
Flush the stream if it's not closed and check its error state. Errors are cumulative; once the stream encounters an error, this routine will return true on all successive calls.

Overrides:
checkError in class GrailsPrintWriter
Returns:
True if the print stream has encountered an error, either on the underlying output stream or during a format conversion.

flush

public void flush()
Description copied from class: GrailsPrintWriter
Flush the stream.

Specified by:
flush in interface Flushable
Overrides:
flush in class GrailsPrintWriter
See Also:
GrailsPrintWriter.checkError()

append

public PrintWriter append(char c)
Specified by:
append in interface Appendable
Overrides:
append in class GrailsPrintWriter

append

public PrintWriter append(CharSequence csq,
                          int start,
                          int end)
Specified by:
append in interface Appendable
Overrides:
append in class GrailsPrintWriter

append

public PrintWriter append(CharSequence csq)
Specified by:
append in interface Appendable
Overrides:
append in class GrailsPrintWriter


Copyright (c) 2005-2009 The Grails project