|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.ditchnet.jsp.util.JspResponseWriter
A JSP-specific XML writing utility class meant to be used as an output
buffer in a JSP tag handler subclass of
SimpleTag. This class should not be viewed
as a general purpose XML writing utility class as several of it's methods
make assumptions about the formatting of
the output that make it's use in a JSP tag handler class more natural.
Note that this class is not thread safe.
| Constructor Summary | |
JspResponseWriter()
Defualt constructor -- Sets pretty printing to 'on'. |
|
JspResponseWriter(boolean prettyPrinting)
Allows instanciating this writer with pretty printing turned off. |
|
| Method Summary | |
void |
attribute(java.lang.String prefix,
Xml.Attr localName,
java.lang.String value)
Write an attribute with this namespace prefix, and local name corresponding values. |
void |
attribute(Xml.Attr qName,
java.lang.String value)
Write an attribute with qualified name and corresponding value. |
void |
comment(java.lang.Object 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. |
void |
endElement(java.lang.String prefix,
Xml.Tag localName)
End an XML element with a namespace prefix and a localName. |
void |
endElement(Xml.Tag qName)
End an XML element with a qualified name. |
java.lang.StringBuffer |
getBuffer()
|
java.io.Writer |
getWriter()
|
boolean |
isPrettyPrinting()
Check for pretty printing setting. |
void |
lineBreak()
This method exists for the convenience of the JSP author in manually controlling the pretty printing of the buffered output. |
void |
setPrettyPrinting(boolean prettyPrinting)
Set this writer to include line breaks and tabstops in the output for easier human-readable markup. |
void |
startElement(java.lang.String prefix,
Xml.Tag localName)
Start an XML element with a namespace prefix and a localName. |
void |
startElement(Xml.Tag qName)
Start an XML element with a qualified name, up to and including the element name. |
void |
tabStop()
|
void |
text(java.lang.Object text)
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JspResponseWriter()
public JspResponseWriter(boolean prettyPrinting)
| Method Detail |
public java.lang.StringBuffer getBuffer()
public java.io.Writer getWriter()
public void setPrettyPrinting(boolean prettyPrinting)
public boolean isPrettyPrinting()
public void tabStop()
public void startElement(Xml.Tag qName)
writeAttribute() or
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(),
comment(), lineBreak(),
text(), endElement()
public void startElement(java.lang.String prefix,
Xml.Tag localName)
public void endElement(Xml.Tag qName)
public void endElement(java.lang.String prefix,
Xml.Tag localName)
public void lineBreak()
public void attribute(Xml.Attr qName,
java.lang.String value)
startElement(), and before the
element has been closed.
NullPointerException
IllegalStateException - if no element tag is
currently open
public void attribute(java.lang.String prefix,
Xml.Attr localName,
java.lang.String value)
startElement(), and before the
element has been closed.
NullPointerException
IllegalStateException - if no element tag is
currently openpublic void text(java.lang.Object text)
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.
text - Text to be written
java.lang.NullPointerException - if text
is nullpublic void comment(java.lang.Object 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. If there is
an open element that has been created by a call to
startElement(), that element will be closed first.
comment - Text content of the comment
java.lang.NullPointerException - if comment
is null
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||