Home » Mojarra-2.0.1 » javax » faces » context » [javadoc | source]
javax.faces.context
abstract public class: ResponseWriter [javadoc | source]
java.lang.Object
   java.io.Writer
      javax.faces.context.ResponseWriter

All Implemented Interfaces:
    Closeable, Flushable, Appendable

Direct Known Subclasses:
    ResponseWriterWrapper, PartialResponseWriter

ResponseWriter is an abstract class describing an adapter to an underlying output mechanism for character-based output. In addition to the low-level write() methods inherited from java.io.Writer, this class provides utility methods that are useful in producing elements and attributes for markup languages like HTML and XML.

Fields inherited from java.io.Writer:
lock
Method from javax.faces.context.ResponseWriter Summary:
cloneWithWriter,   endCDATA,   endDocument,   endElement,   flush,   getCharacterEncoding,   getContentType,   startCDATA,   startDocument,   startElement,   writeAttribute,   writeComment,   writeText,   writeText,   writeText,   writeURIAttribute
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.faces.context.ResponseWriter Detail:
 abstract public ResponseWriter cloneWithWriter(Writer writer)

    Create and return a new instance of this ResponseWriter , using the specified Writer as the output destination.

 public  void endCDATA() throws IOException 

    Close an XML CDATA block. The default implementation of this method takes no action when invoked.

 abstract public  void endDocument() throws IOException

    Write whatever text should end a response. If there is an open element that has been created by a call to startElement(), that element will be closed first.

 abstract public  void endElement(String name) throws IOException

    Write the end of an element, after closing any open element created by a call to startElement(). Elements must be closed in the inverse order from which they were opened; it is an error to do otherwise.

 abstract public  void flush() throws IOException

    Flush any ouput buffered by the output method to the underlying Writer or OutputStream. This method will not flush the underlying Writer or OutputStream; it simply clears any values buffered by this ResponseWriter .

 abstract public String getCharacterEncoding()

    Return the character encoding (such as "ISO-8859-1") for this ResponseWriter . Please see the IANA for a list of character encodings.

 abstract public String getContentType()

    Return the content type (such as "text/html") for this ResponseWriter . Note: this must not include the "charset=" suffix.

 public  void startCDATA() throws IOException 

    Open an XML CDATA block. Note that XML does not allow nested CDATA blocks, though this method does not enforce that constraint. The default implementation of this method takes no action when invoked.

 abstract public  void startDocument() throws IOException

    Write whatever text should begin a response.

 abstract public  void startElement(String name,
    UIComponent component) throws IOException

    Write the start of an element, up to and including the element name. Once this method has been called, clients can call the writeAttribute() or writeURIAttribute() methods to add attributes and corresponding values. The starting element will be closed (that is, the trailing '>' character added) on any subsequent call to startElement(), writeComment(), writeText(), endElement(), endDocument(), close(), flush(), or write().

 abstract public  void writeAttribute(String name,
    Object value,
    String property) throws IOException

    Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. This method may only be called after a call to startElement(), and before the opened element has been closed.

 abstract public  void writeComment(Object comment) throws IOException

    Write a comment containing the specified text, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

 abstract public  void writeText(Object text,
    String property) throws IOException

    Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

 public  void writeText(Object text,
    UIComponent component,
    String property) throws IOException 

    Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. This method is equivalent to #writeText(java.lang.Object,java.lang.String) but adds a component property to allow custom ResponseWriter implementations to associate a component with an arbitrary portion of text.

    The default implementation simply ignores the component argument and calls through to #writeText(java.lang.Object,java.lang.String)

 abstract public  void writeText(char[] text,
    int off,
    int len) throws IOException

    Write text from a character array, after any performing any escaping appropriate for the markup language being rendered. If there is an open element that has been created by a call to startElement(), that element will be closed first.

 abstract public  void writeURIAttribute(String name,
    Object value,
    String property) throws IOException

    Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered. This method may only be called after a call to startElement(), and before the opened element has been closed.