| org.netbeans.modules.visualweb.jsfsupport.container.PrettyJspWriter
PrettyJspWriter | public class PrettyJspWriter extends ResponseWriter (Code) | | PrettyJspWriter provides a pretty-formated JSP writer needed for JSP generation
author: Robert Brewin, Carl Quinn version: 1.0 |
Method Summary | |
public ResponseWriter | cloneWithWriter(Writer writer) Creates a new instance of this ResponseWriter, using a different Writer. | public void | close() Close the stream, flushing it first. | public void | endDocument() Write whatever text should end a response. | public void | endElement(String name) Write the end of an element, after closing any open element
created by a call to startElement() . | public void | flush() Flush the stream. | public String | getCharacterEncoding() the character encoding, such as "ISO-8859-1" for thisResponseWriter. | public String | getContentType() | public int | getCurrentIndent() | public int | getPosition() | public void | indent() | public void | outdent() | public void | reset(int position) Truncates the written content back to a particular position/index specified. | public void | setIndentAmount(int indentAmount) | public void | setOutputWriter(ResettableStringWriter outputWriter) | public void | startDocument() | public void | startElement(String name, UIComponent componentForElement) Write the start of an element, up to and including the
element name. | public void | write(char cbuf) | public void | write(char[] cbuf, int off, int len) | public void | write(int c) | public void | write(String str) | public void | write(String str, int off, int len) | public void | writeAttribute(String name, Object value, String componentPropertyName) Write an attribute name and corresponding value (after converting
that text to a String if necessary), after escaping it properly.
This method may only be called after a call to
startElement() , and before the opened element has been
closed.
Parameters: name - Attribute name to be added Parameters: value - Attribute value to be added Parameters: componentPropertyName - May be null . | public void | writeComment(Object comment) Write a comment containing the specified text, after converting
that text to a String if necessary. | public void | writeText(Object text, String componentPropertyName) Write an object (after converting it to a String, if necessary),
after escaping it properly. | public void | writeText(char text) Write a single character, after escaping it properly. | public void | writeText(char[] text, int off, int len) Write text from a character array, after escaping it properly
for this method. | public void | writeURIAttribute(String name, Object value, String componentPropertyName) Write a URI attribute name and corresponding value (after converting
that text to a String if necessary), after encoding it properly
(for example, '%' encoded for HTML).
This method may only be called after a call to
startElement() , and before the opened element has been
closed.
Parameters: name - Attribute name to be added Parameters: value - Attribute value to be added Parameters: componentPropertyName - May be null . |
PrettyJspWriter | public PrettyJspWriter()(Code) | | Construct the PrettyJspWriter
|
cloneWithWriter | public ResponseWriter cloneWithWriter(Writer writer)(Code) | | Creates a new instance of this ResponseWriter, using a different Writer.
|
close | public void close() throws IOException(Code) | | Close the stream, flushing it first. Once a stream has been closed, further write() or
flush() invocations will cause an IOException to be thrown. Closing a previously-closed
stream, however, has no effect.
exception: java.io.IOException - If an I/O error occurs |
endDocument | public void endDocument() throws IOException(Code) | | 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.
exception: java.io.IOException - if an input/output error occurs |
flush | public void flush() throws IOException(Code) | | Flush the stream. If the stream has saved any characters from the
various write() methods in a buffer, write them immediately to their
intended destination. Then, if that destination is another character or
byte stream, flush it. Thus one flush() invocation will flush all the
buffers in a chain of Writers and OutputStreams.
exception: java.io.IOException - If an I/O error occurs |
getCharacterEncoding | public String getCharacterEncoding()(Code) | | the character encoding, such as "ISO-8859-1" for thisResponseWriter. Please see theIANA for a list of character encodings. |
getContentType | public String getContentType()(Code) | | the content type, such as "text/html" for thisResponseWriter. |
getCurrentIndent | public int getCurrentIndent()(Code) | | Get the current indentation amount
the indent amount |
getPosition | public int getPosition()(Code) | | |
indent | public void indent()(Code) | | Increment the current indent
|
outdent | public void outdent()(Code) | | Decrement the current indent
|
reset | public void reset(int position)(Code) | | Truncates the written content back to a particular position/index specified. Note:
Should only be used to reset back to a position outside of a tag, since it will clear the
"closeStart" flag.
Parameters: position - The position to jump back to. |
setIndentAmount | public void setIndentAmount(int indentAmount)(Code) | | Set the amount to indent
Parameters: indentAmount - |
setOutputWriter | public void setOutputWriter(ResettableStringWriter outputWriter)(Code) | | Set the output writer
Parameters: outputWriter - -- the new Writer to use for emission |
startElement | public void startElement(String name, UIComponent componentForElement) throws IOException(Code) | | Write the start of an element, up to and including the
element name. Once this method has been called, clients can
call writeAttribute() or writeURIAttribute()
method 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() , or
endDocument() .
Parameters: name - Name of the element to be started Parameters: componentForElement - May be null . Ifnon-null , must be the UIComponent instance to whichthis element corresponds. exception: IOException - if an input/output error occurs exception: NullPointerException - if name is null |
writeAttribute | public void writeAttribute(String name, Object value, String componentPropertyName) throws IOException(Code) | | Write an attribute name and corresponding value (after converting
that text to a String if necessary), after escaping it properly.
This method may only be called after a call to
startElement() , and before the opened element has been
closed.
Parameters: name - Attribute name to be added Parameters: value - Attribute value to be added Parameters: componentPropertyName - May be null . Ifnon-null , this must be the name of the property onthe UIComponent passed in to a previous call to PrettyJspWriter.startElement to which this attribute corresponds. exception: IllegalStateException - if this method is called when thereis no currently open element exception: IOException - if an input/output error occurs exception: NullPointerException - if name isnull |
writeComment | public void writeComment(Object comment) throws IOException(Code) | | Write a comment containing the specified text, after converting
that text 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.
Parameters: comment - Text content of the comment exception: java.io.IOException - if an input/output error occurs exception: java.lang.NullPointerException - if comment is null |
writeText | public void writeText(Object text, String componentPropertyName) throws IOException(Code) | | Write an object (after converting it to a String, if necessary),
after escaping it properly. 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.
Parameters: text - Text to be written Parameters: componentPropertyName - May be null . Ifnon-null , this is the name of the property in theassociated component to which this piece of text applies. exception: IOException - if an input/output error occurs exception: NullPointerException - if text is null |
writeText | public void writeText(char text) throws IOException(Code) | | Write a single character, after escaping it properly. 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 exception: java.io.IOException - if an input/output error occurs |
writeText | public void writeText(char[] text, int off, int len) throws IOException(Code) | | Write text from a character array, after escaping it properly
for this method. 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 Parameters: off - Starting offset (zero-relative) Parameters: len - Number of characters to be written exception: java.lang.IndexOutOfBoundsException - if the calculated starting orending position is outside the bounds of the character array exception: java.io.IOException - if an input/output error occurs exception: java.lang.NullPointerException - if text is null |
writeURIAttribute | public void writeURIAttribute(String name, Object value, String componentPropertyName) throws IOException(Code) | | Write a URI attribute name and corresponding value (after converting
that text to a String if necessary), after encoding it properly
(for example, '%' encoded for HTML).
This method may only be called after a call to
startElement() , and before the opened element has been
closed.
Parameters: name - Attribute name to be added Parameters: value - Attribute value to be added Parameters: componentPropertyName - May be null . Ifnon-null , this must be the name of the property onthe UIComponent passed in to a previous call to PrettyJspWriter.startElement to which this attribute corresponds. exception: IllegalStateException - if this method is called when thereis no currently open element exception: IOException - if an input/output error occurs exception: NullPointerException - if name isnull |
|
|