Home » apache-tomcat-6.0.26-src » javax » servlet » jsp » tagext » [javadoc | source]
abstract public class: BodyContent [javadoc | source]

All Implemented Interfaces:
    Closeable, Flushable, Appendable

An encapsulation of the evaluation of the body of an action so it is available to a tag handler. BodyContent is a subclass of JspWriter.

Note that the content of BodyContent is the result of evaluation, so it will not contain actions and the like, but the result of their invocation.

BodyContent has methods to convert its contents into a String, to read its contents, and to clear the contents.

The buffer size of a BodyContent object is unbounded. A BodyContent object cannot be in autoFlush mode. It is not possible to invoke flush on a BodyContent object, as there is no backing stream.

Instances of BodyContent are created by invoking the pushBody and popBody methods of the PageContext class. A BodyContent is enclosed within another JspWriter (maybe another BodyContent object) following the structure of their associated actions.

A BodyContent is made available to a BodyTag through a setBodyContent() call. The tag handler can use the object until after the call to doEndTag().
Fields inherited from javax.servlet.jsp.JspWriter:
Fields inherited from java.io.Writer:
 protected BodyContent(JspWriter e) 
    Protected constructor. Unbounded buffer, no autoflushing.
    e - the enclosing JspWriter
Method from javax.servlet.jsp.tagext.BodyContent Summary:
clearBody,   flush,   getEnclosingWriter,   getReader,   getString,   writeOut
Methods from javax.servlet.jsp.JspWriter:
clear,   clearBuffer,   close,   flush,   getBufferSize,   getRemaining,   isAutoFlush,   newLine,   print,   print,   print,   print,   print,   print,   print,   print,   print,   println,   println,   println,   println,   println,   println,   println,   println,   println,   println
Methods from java.io.Writer:
append,   append,   append,   append,   append,   append,   close,   flush,   write,   write,   write,   write,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.servlet.jsp.tagext.BodyContent Detail:
 public  void clearBody() 
    Clear the body without throwing any exceptions.
 public  void flush() throws IOException 
    Redefined flush() so it is not legal.

    It is not valid to flush a BodyContent because there is no backing stream behind it.

 public JspWriter getEnclosingWriter() 
    Get the enclosing JspWriter.
 abstract public Reader getReader()
    Return the value of this BodyContent as a Reader.
 abstract public String getString()
    Return the value of the BodyContent as a String.
 abstract public  void writeOut(Writer out) throws IOException
    Write the contents of this BodyContent into a Writer. Subclasses may optimize common invocation patterns.