Save This Page
Home » mojarra-1.2_09-b02-FCS-source » com.sun.faces.renderkit.html_basic » [javadoc | source]
com.sun.faces.renderkit.html_basic
public class: HtmlResponseWriter [javadoc | source]
java.lang.Object
   javax.faces.context.ResponseWriter
      com.sun.faces.renderkit.html_basic.HtmlResponseWriter

HtmlResponseWriter is an Html specific implementation of the ResponseWriter abstract class. Kudos to Adam Winer (Oracle) for much of this code.
Field Summary
static final  Pattern CDATA_START_SLASH_SLASH     
static final  Pattern CDATA_END_SLASH_SLASH     
static final  Pattern CDATA_START_SLASH_STAR     
static final  Pattern CDATA_END_SLASH_STAR     
Constructor:
 public HtmlResponseWriter(Writer writer,
    String contentType,
    String encoding) throws FacesException 
    Constructor sets the ResponseWriter and encoding, and enables script hiding by default.
    Parameters:
    writer - the ResponseWriter
    contentType - the content type.
    encoding - the character encoding.
    Throws:
    javax.faces.FacesException - the encoding is not recognized.
 public HtmlResponseWriter(Writer writer,
    String contentType,
    String encoding,
    Boolean isScriptHidingEnabled,
    Boolean isScriptInAttributeValueEnabled,
    WebConfiguration.DisableUnicodeEscaping disableUnicodeEscaping) throws FacesException 

    Constructor sets the ResponseWriter and encoding.

    The argument configPrefs is a map of configurable prefs that affect this instance's behavior. Supported keys are:

    BooleanWebContextInitParameter.EnableJSStyleHiding: true if the writer should attempt to hide JS from older browsers

    Parameters:
    writer - the ResponseWriter
    contentType - the content type.
    encoding - the character encoding.
    Throws:
    javax.faces.FacesException - the encoding is not recognized.
Method from com.sun.faces.renderkit.html_basic.HtmlResponseWriter Summary:
cloneWithWriter,   close,   endDocument,   endElement,   flush,   getCharacterEncoding,   getContentType,   startDocument,   startElement,   write,   write,   write,   write,   write,   writeAttribute,   writeComment,   writeText,   writeText,   writeText,   writeText,   writeURIAttribute
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.faces.renderkit.html_basic.HtmlResponseWriter Detail:
 public ResponseWriter cloneWithWriter(Writer writer) 

    Create a new instance of this ResponseWriter using a different Writer.

 public  void close() throws IOException 
    Methods From java.io.Writer
 public  void endDocument() throws IOException 
    Output the text for the end of a document.
 public  void endElement(String name) throws IOException 

    Write the end of an element. This method will first close any open element created by a call to startElement().

 public  void flush() throws IOException 
    Flush any buffered output to the contained writer.
 public String getCharacterEncoding() 
 public String getContentType() 
 public  void startDocument() throws IOException 

    Write the text that should begin a response.

 public  void startElement(String name,
    UIComponent componentForElement) throws IOException 

    Write the start of an element, up to and including the element name. Clients call writeAttribute() or writeURIAttribute() methods to add attributes after calling this method.

 public  void write(char[] cbuf) throws IOException 
 public  void write(int c) throws IOException 
 public  void write(String str) throws IOException 
 public  void write(char[] cbuf,
    int off,
    int len) throws IOException 
 public  void write(String str,
    int off,
    int len) throws IOException 
 public  void writeAttribute(String name,
    Object value,
    String componentPropertyName) throws IOException 

    Write a properly escaped attribute name and the corresponding value. The value text will be converted to a String if necessary. This method may only be called after a call to startElement(), and before the opened element has been closed.

 public  void writeComment(Object comment) throws IOException 

    Write a comment string containing the specified text. The text will be converted to a String if necessary. If there is an open element that has been created by a call to startElement(), that element will be closed first.

 public  void writeText(char text) throws IOException 

    Write a properly escaped single character, If there is an open element that has been created by a call to startElement(), that element will be closed first.

    All angle bracket occurrences in the argument must be escaped using the > < syntax.

 public  void writeText(char[] text) throws IOException 

    Write properly escaped text from a character array. The output from this command is identical to the invocation: writeText(c, 0, c.length). If there is an open element that has been created by a call to startElement(), that element will be closed first.

    All angle bracket occurrences in the argument must be escaped using the > < syntax.

 public  void writeText(Object text,
    String componentPropertyName) throws IOException 

    Write a properly escaped object. The object will be converted to a String if necessary. If there is an open element that has been created by a call to startElement(), that element will be closed first.

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

    Write properly escaped text from a character array. If there is an open element that has been created by a call to startElement(), that element will be closed first.

    All angle bracket occurrences in the argument must be escaped using the > < syntax.

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

    Write a properly encoded URI attribute name and the corresponding value. The value text will be converted to a String if necessary). This method may only be called after a call to startElement(), and before the opened element has been closed.