| org.netbeans.modules.visualweb.insync.faces.DocFragmentJspWriter
DocFragmentJspWriter | class DocFragmentJspWriter extends ResponseWriter (Code) | | DocFragmentJspWriter provides a direct-to-DOM JSP writer for improved design-time DOM handling
author: Carl Quinn author: Tor Norbye version: 1.1 |
Method Summary | |
public Node | appendTextNode(String text) | 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 Node | getCurrent() | public int | getDepth() Return the depth of the current target node being rendered by the
jsp writer. | public DocumentFragment | getFragment() | public Node | importNode(Node node, boolean deep) Import a node into the written dom tree. | public void | popNode() | public void | setCurrent(Node current, int depth) Ensure that we're done with the given node. | public void | setPreRendered(UIComponent bean, DocumentFragment df) Set the "pre rendered" DocumentFragment for a particular bean.
Note: Only ONE bean can be pre-rendered at a time; this is not
a per-bean assignment. | 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 . |
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. |
getCurrent | public Node getCurrent()(Code) | | Return the current target node being rendered to by the jsp writer
|
getDepth | public int getDepth()(Code) | | Return the depth of the current target node being rendered by the
jsp writer. The document fragment starts out at depth 0.
|
getFragment | public DocumentFragment getFragment()(Code) | | Return the DocumentFragment being constructed by the writer
|
importNode | public Node importNode(Node node, boolean deep)(Code) | | Import a node into the written dom tree. If deep is true just clone it in and continue at the
same level. If close is false, then import one node & descend.
Parameters: node - Node to be copied Parameters: deep - If true, copy recursively, e.g. include all children of node as well The imported node |
popNode | public void popNode()(Code) | | Pop up a level after doing a non-deep import
|
setCurrent | public void setCurrent(Node current, int depth)(Code) | | Ensure that we're done with the given node. Called to "rollback"
in case a child has aborted during render.
|
setPreRendered | public void setPreRendered(UIComponent bean, DocumentFragment df)(Code) | | Set the "pre rendered" DocumentFragment for a particular bean.
Note: Only ONE bean can be pre-rendered at a time; this is not
a per-bean assignment. When set, this will cause the given
DocumentFragment to be inserted into the output fragment
rather than calling the bean's renderer.
This is intended to be used for for example having the ability
to "inline edit" a particular component's value; in that case
since we're not updating the value attribute during editing,
we want to suppress the normal rendered portion from the component
and instead substitute the inline-edited document fragment
corresponding to the parsed text output of the component.
|
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 DocFragmentJspWriter.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 DocFragmentJspWriter.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 |
|
|