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.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract ResponseWriter | Returns: the newResponseWriterThe writer)Writer that is the output destination
Create and return a new instance of this |
| public void | |
| public abstract void | |
| public abstract void | endElement(String
Name of the element to be ended name)
Write the end of an element, after closing any open element created by a
call to |
| public abstract void | flush()
Redeclares java. Implements abstract java. Flush any ouput buffered by the output method to the underlying Writer or OutputStream. |
| public abstract String | Returns: the character encoding
Return the character encoding (such as "ISO-8859-1") for this |
| public abstract String | Returns: the content type
Return the content type (such as "text/html") for this |
| public void | |
| public abstract void | |
| public abstract void | startElement(String
Name of the element to be started name, UIComponent The component)UIComponent (if any) to which this element corresponds.
This component is inspected for its pass through attributes as described in the standard HTML_BASIC RenderKit specification.Write the start of an element, up to and including the element name. |
| public abstract void | writeAttribute(String
Attribute name to be added name, Object Attribute value to be added value, String Name of the property or attribute (if any) of the property)UIComponent associated with the containing
element, to which this generated attribute correspondsWrite 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. |
| public abstract void | writeComment(Object
Text content of the comment comment)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. |
| public void | writeDoctype(String
Text content of the doctype doctype)Write a string containing the markup specific doctype. |
| public void | writePreamble(String
Text content of the preamble preamble)Write a string containing the markup specific preamble. |
| public abstract void | writeText(Object
Text to be written text, String Name of the property or attribute (if any) of the property)UIComponent associated with the containing
element, to which this generated text correspondsWrite an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
| public void | writeText(Object
Text to be written text, UIComponent The component, String UIComponent (if any) to which this element correspondsName of the property or attribute (if any) of the property)UIComponent associated with the containing
element, to which this generated text correspondsWrite an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
| public abstract void | writeText(char[]
Text to be written text, int Starting offset (zero-relative) off, int Number of characters to be written len)Write text from a character array, after any performing any escaping appropriate for the markup language being rendered. |
| public abstract void | writeURIAttribute(String
Attribute name to be added name, Object Attribute value to be added value, String Name of the property or attribute (if any) of the property)UIComponent associated with the containing
element, to which this generated attribute correspondsWrite a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding or escaping appropriate to the markup language being rendered. |
| ResponseWriter | back to summary |
|---|---|
| public ResponseWriter() | |
| cloneWithWriter | back to summary |
|---|---|
| public abstract ResponseWriter cloneWithWriter(Writer writer)
Create and return a new instance of this
| |
| endCDATA | back to summary |
|---|---|
| public void endCDATA() throws IOException
Close an XML
| |
| endDocument | back to summary |
|---|---|
| public abstract 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
| |
| endElement | back to summary |
|---|---|
| public abstract void endElement(String name) throws IOException
Write the end of an element, after closing any open element created by a
call to
If the argument component's pass through attributes includes an attribute of the name given by the value of the
symbolic constant
| |
| flush | back to summary |
|---|---|
| public abstract void flush() throws IOException Redeclares java. Implements abstract java.
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
| |
| getCharacterEncoding | back to summary |
|---|---|
| public abstract String getCharacterEncoding()
Return the character encoding (such as "ISO-8859-1") for this
| |
| getContentType | back to summary |
|---|---|
| public abstract String getContentType()
Return the content type (such as "text/html") for this Note this must not include the "charset=" suffix.
| |
| startCDATA | back to summary |
|---|---|
| public void startCDATA() throws IOException
Open an XML
| |
| startDocument | back to summary |
|---|---|
| public abstract void startDocument() throws IOException Write whatever text should begin a response.
| |
| startElement | back to summary |
|---|---|
| public abstract 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
If the argument component's pass through attributes includes an attribute of the name given by the value of the
symbolic constant
| |
| writeAttribute | back to summary |
|---|---|
| public abstract 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
| |
| writeComment | back to summary |
|---|---|
| public abstract 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
| |
| writeDoctype | back to summary |
|---|---|
| public void writeDoctype(String doctype) throws IOException
Write a string containing the markup specific doctype. No escaping is performed. The default implementation simply
calls through to The implementation makes no checks if this is the correct place in the response to have a doctype, nor does it prevent the doctype from being written more than once.
| |
| writePreamble | back to summary |
|---|---|
| public void writePreamble(String preamble) throws IOException
Write a string containing the markup specific preamble. No escaping is performed. The default implementation simply
calls through to The implementation makes no checks if this is the correct place in the response to have a preamble, nor does it prevent the preamble from being written more than once.
| |
| writeText | back to summary |
|---|---|
| public abstract 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
| |
| writeText | back to summary |
|---|---|
| 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
The default implementation simply ignores the
| |
| writeText | back to summary |
|---|---|
| public abstract 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
| |
| writeURIAttribute | back to summary |
|---|---|
| public abstract 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 or
escaping appropriate to the markup language being rendered. When rendering
in a WWW environment, the escaping conventions established in the W3C URI spec document
<http://www.w3.org/Addressing/URL/uri-spec.html>
must be followed. In particular, spaces ' ' must be encoded as %20 and not the plus character '+'. This method
may only be called after a call to
| |