org.freehep.webutil.util.writer
Class JspResponseWriter

java.lang.Object
  extended by org.freehep.webutil.util.writer.JspResponseWriter

public final class JspResponseWriter
extends Object


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(String qName, String value)
          Write an attribute with qualified name and corresponding value.
 void attribute(String prefix, String localName, String value)
          Write an attribute with this namespace prefix, and local name corresponding values.
 void comment(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(String qName)
          End an XML element with a qualified name.
 void endElement(String prefix, String localName)
          End an XML element with a namespace prefix and a localName.
 void endElementNow(String qName)
          End an XML element with a qualified name.
 void endElementNow(String prefix, String localName)
          End an XML element with a namespace prefix and a localName.
 StringBuffer getBuffer()
           
 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(String qName)
          Start an XML element with a qualified name, up to and including the element name.
 void startElement(String prefix, String localName)
          Start an XML element with a namespace prefix and a localName.
 void tabStop()
           
 void text(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

JspResponseWriter

public JspResponseWriter()
Defualt constructor -- Sets pretty printing to 'on'.


JspResponseWriter

public JspResponseWriter(boolean prettyPrinting)
Allows instanciating this writer with pretty printing turned off.

Method Detail

getBuffer

public StringBuffer getBuffer()

getWriter

public Writer getWriter()

setPrettyPrinting

public void setPrettyPrinting(boolean prettyPrinting)
Set this writer to include line breaks and tabstops in the output for easier human-readable markup.


isPrettyPrinting

public boolean isPrettyPrinting()
Check for pretty printing setting.


tabStop

public void tabStop()

startElement

public void startElement(String qName)
Start an XML element with a qualified name, up to and including the element name. Once this method has been called, clients can call the 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()


startElement

public void startElement(String prefix,
                         String localName)
Start an XML element with a namespace prefix and a localName.


endElement

public void endElement(String qName)
End an XML element with a qualified name.


endElement

public void endElement(String prefix,
                       String localName)
End an XML element with a namespace prefix and a localName.


endElementNow

public void endElementNow(String qName)
End an XML element with a qualified name.


endElementNow

public void endElementNow(String prefix,
                          String localName)
End an XML element with a namespace prefix and a localName.


lineBreak

public void lineBreak()
This method exists for the convenience of the JSP author in manually controlling the pretty printing of the buffered output.


attribute

public void attribute(String qName,
                      String value)
Write an attribute with qualified name and corresponding value. This method may only be called after a call to startElement(), and before the element has been closed.

Throws:
NullPointerException
IllegalStateException - if no element tag is currently open

attribute

public void attribute(String prefix,
                      String localName,
                      String value)
Write an attribute with this namespace prefix, and local name corresponding values. This method may only be called after a call to startElement(), and before the element has been closed.

Throws:
NullPointerException
IllegalStateException - if no element tag is currently open

text

public void text(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.

Parameters:
text - Text to be written
Throws:
NullPointerException - if text is null

comment

public void comment(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.

Parameters:
comment - Text content of the comment
Throws:
NullPointerException - if comment is null


Copyright © 2000-2009 FreeHEP. All Rights Reserved.