HtmlResponseWriter is an Html specific implementation
of the ResponseWriter abstract class.
Kudos to Adam Winer (Oracle) for much of this code.
| Modifier and Type | Field and Description |
|---|---|
| private FastStringWriter | |
| private static final String | |
| private char[] | |
| pack-priv static final Pattern | |
| pack-priv static final Pattern | |
| pack-priv static final Pattern | |
| pack-priv static final Pattern | |
| private char[] | |
| private int | |
| private static final int | |
| private char[] | |
| private static final int | |
| private char[] | |
| private static final int | |
| private boolean | |
| private String | |
| private WebConfiguration. | |
| private boolean | |
| private LinkedList | |
| private String | |
| private static final char[] | |
| private static final char[] | |
| private static final char[] | |
| private static final char[] | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private Boolean | |
| private Boolean | |
| private boolean | |
| private boolean | |
| private static final int | |
| private Writer | |
| private Map | |
| private FastStringWriter | |
| private boolean | |
| private char[] | |
| private boolean | |
| private boolean | |
| private Writer | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | HtmlResponseWriter(Writer
the writer, String ResponseWriterthe content type. contentType, String the character encoding. encoding)Constructor sets the |
| public | HtmlResponseWriter(Writer
the writer, String ResponseWriterthe content type. contentType, String the character encoding. encoding, Boolean isScriptHidingEnabled, Boolean isScriptInAttributeValueEnabled, WebConfiguration.Constructor sets the |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public ResponseWriter | cloneWithWriter(Writer
The writer)Writer that will be used to create
another ResponseWriter.Implements abstract javax. Create a new instance of this |
| public void | close()
Implements abstract java. Implements java. java.io.Writer
|
| private void | |
| private void | |
| private boolean | |
| public void | |
| public void | endDocument()
Implements abstract javax. |
| public void | endElement(String
Name of the element to be ended name)Implements abstract javax. Write the end of an element. |
| private void | |
| public void | flush()
Implements abstract javax. Implements java. |
| private void | |
| private void | |
| private String | |
| public String | Returns: the character encoding, such as "ISO-8859-1" for this ResponseWriter. Refer to: theIANA for a list of character encodings.Implements abstract javax. Return the character encoding (such as "ISO-8859-1") for this
|
| public String | Returns: the content type such as "text/html" for this ResponseWriter.Implements abstract javax. Return the content type (such as "text/html") for this |
| private String | |
| private WebConfiguration | |
| private boolean | |
| private boolean | |
| private String | |
| private String | |
| public void | |
| public void | startDocument()
Implements abstract javax. Write the text that should begin a response. |
| public void | startElement(String
Name of the starting element name, UIComponent The UIComponent instance that applies to this
element. This argument may be componentForElement)null.Implements abstract javax. Write the start of an element, up to and including the element name. |
| public void | write(char[]
Array of characters to be written cbuf)Overrides java. |
| public void | write(int
int specifying a character to be written c)Overrides java. |
| public void | |
| public void | write(char[]
Array of characters cbuf, int Offset from which to start writing characters off, int Number of characters to write len)Implements abstract java. |
| public void | write(String
A String str, int Offset from which to start writing characters off, int Number of characters to write len)Overrides java. |
| public void | writeAttribute(String
Attribute name to be added name, Object Attribute value to be added value, String The name of the component property to
which this attribute argument applies. This argument may be
componentPropertyName)null.Implements abstract javax. Write a properly escaped attribute name and the corresponding value. |
| public void | writeComment(Object
Text content of the comment comment)Implements abstract javax. Write a comment string containing the specified text. |
| private void | |
| public void | writeText(char
Text to be written text)Write a properly escaped single character, If there
is an open element that has been created by a call to
|
| public void | |
| public void | writeText(Object
Text to be written text, String The name of the component property to
which this text argument applies. This argument may be componentPropertyName)null.Implements abstract javax. Write a properly escaped object. |
| public void | writeText(char[]
Text to be written text, int Starting offset (zero-relative) off, int Number of characters to be written len)Implements abstract javax. Write properly escaped text from a character array. |
| public void | writeURIAttribute(String
Attribute name to be added name, Object Attribute value to be added value, String The name of the component property to
which this attribute argument applies. This argument may be
componentPropertyName)null.Implements abstract javax. Write a properly encoded URI attribute name and the corresponding value. |
| private void | writeURIAttributeIgnoringPassThroughAttributes(String name, Object value, String componentPropertyName, boolean isPassthrough)
|
| attributesBuffer | back to summary |
|---|---|
| private FastStringWriter attributesBuffer | |
| BREAKCDATA | back to summary |
|---|---|
| private static final String BREAKCDATA | |
| buffer | back to summary |
|---|---|
| private char[] buffer | |
| CDATA_END_SLASH_SLASH | back to summary |
|---|---|
| pack-priv static final Pattern CDATA_END_SLASH_SLASH | |
| CDATA_END_SLASH_STAR | back to summary |
|---|---|
| pack-priv static final Pattern CDATA_END_SLASH_STAR | |
| CDATA_START_SLASH_SLASH | back to summary |
|---|---|
| pack-priv static final Pattern CDATA_START_SLASH_SLASH | |
| CDATA_START_SLASH_STAR | back to summary |
|---|---|
| pack-priv static final Pattern CDATA_START_SLASH_STAR | |
| cdataBuffer | back to summary |
|---|---|
| private char[] cdataBuffer | |
| cdataBufferLength | back to summary |
|---|---|
| private int cdataBufferLength | |
| cdataBufferSize | back to summary |
|---|---|
| private static final int cdataBufferSize | |
| cdataTextBuffer | back to summary |
|---|---|
| private char[] cdataTextBuffer | |
| cdataTextBufferSize | back to summary |
|---|---|
| private static final int cdataTextBufferSize | |
| charHolder | back to summary |
|---|---|
| private char[] charHolder | |
| CLOSEBRACKET | back to summary |
|---|---|
| private static final int CLOSEBRACKET | |
| closeStart | back to summary |
|---|---|
| private boolean closeStart | |
| contentType | back to summary |
|---|---|
| private String contentType | |
| disableUnicodeEscaping | back to summary |
|---|---|
| private WebConfiguration. | |
| dontEscape | back to summary |
|---|---|
| private boolean dontEscape | |
| elementNames | back to summary |
|---|---|
| private LinkedList<String> elementNames | |
| encoding | back to summary |
|---|---|
| private String encoding | |
| ESCAPEDEND | back to summary |
|---|---|
| private static final char[] ESCAPEDEND | |
| ESCAPEDLT | back to summary |
|---|---|
| private static final char[] ESCAPEDLT | |
| ESCAPEDSINGLEBRACKET | back to summary |
|---|---|
| private static final char[] ESCAPEDSINGLEBRACKET | |
| ESCAPEDSTART | back to summary |
|---|---|
| private static final char[] ESCAPEDSTART | |
| escapeIso | back to summary |
|---|---|
| private boolean escapeIso | |
| escapeUnicode | back to summary |
|---|---|
| private boolean escapeUnicode | |
| isCdata | back to summary |
|---|---|
| private boolean isCdata | |
| isPartial | back to summary |
|---|---|
| private boolean isPartial | |
| isScript | back to summary |
|---|---|
| private boolean isScript | |
| isScriptHidingEnabled | back to summary |
|---|---|
| private Boolean isScriptHidingEnabled | |
| isScriptInAttributeValueEnabled | back to summary |
|---|---|
| private Boolean isScriptInAttributeValueEnabled | |
| isStyle | back to summary |
|---|---|
| private boolean isStyle | |
| isXhtml | back to summary |
|---|---|
| private boolean isXhtml | |
| LT | back to summary |
|---|---|
| private static final int LT | |
| origWriter | back to summary |
|---|---|
| private Writer origWriter | |
| passthroughAttributes | back to summary |
|---|---|
| private Map<String, Object> passthroughAttributes | |
| scriptBuffer | back to summary |
|---|---|
| private FastStringWriter scriptBuffer | |
| scriptOrStyleSrc | back to summary |
|---|---|
| private boolean scriptOrStyleSrc | |
| textBuffer | back to summary |
|---|---|
| private char[] textBuffer | |
| withinScript | back to summary |
|---|---|
| private boolean withinScript | |
| withinStyle | back to summary |
|---|---|
| private boolean withinStyle | |
| writer | back to summary |
|---|---|
| private Writer writer | |
| writingCdata | back to summary |
|---|---|
| private boolean writingCdata | |
| HtmlResponseWriter | back to summary |
|---|---|
| public HtmlResponseWriter(Writer writer, String contentType, String encoding) throws FacesException Constructor sets the
| |
| HtmlResponseWriter | back to summary |
|---|---|
| public HtmlResponseWriter(Writer writer, String contentType, String encoding, Boolean isScriptHidingEnabled, Boolean isScriptInAttributeValueEnabled, WebConfiguration. Constructor sets the The argument configPrefs is a map of configurable prefs that affect this instance's behavior. Supported keys are: BooleanWebContextInitParameter.EnableJSStyleHiding:
| |
| appendBuffer | back to summary |
|---|---|
| private void appendBuffer(char[] cbuf) throws IOException | |
| appendBuffer | back to summary |
|---|---|
| private void appendBuffer(char c) throws IOException | |
| cloneWithWriter | back to summary |
|---|---|
| public ResponseWriter cloneWithWriter(Writer writer) Implements abstract javax. Create a new instance of this
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Methods From
| |
| closeStartIfNecessary | back to summary |
|---|---|
| private void closeStartIfNecessary() throws IOException This method automatically closes a previous element (if not already closed).
| |
| considerPassThroughAttributes | back to summary |
|---|---|
| private void considerPassThroughAttributes(Map<String, Object> toCopy) | |
| containsPassThroughAttribute | back to summary |
|---|---|
| private boolean containsPassThroughAttribute(String attrName) | |
| endCDATA | back to summary |
|---|---|
| public void endCDATA() throws IOException Overrides javax. Closes the CDATA block.
| |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws IOException Implements abstract javax. Output the text for the end of a document.
| |
| endElement | back to summary |
|---|---|
| public void endElement(String name) throws IOException Implements abstract javax. Write the end of an element. This method will first
close any open element created by a call to
| |
| ensureTextBufferCapacity | back to summary |
|---|---|
| private void ensureTextBufferCapacity(String source) | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract javax. Implements java. Flush any buffered output to the contained writer.
| |
| flushAttributes | back to summary |
|---|---|
| private void flushAttributes() throws IOException | |
| flushBuffer | back to summary |
|---|---|
| private void flushBuffer() throws IOException | |
| getAttributeValue | back to summary |
|---|---|
| private String getAttributeValue(FacesContext context, Object valObj) | |
| getCharacterEncoding | back to summary |
|---|---|
| public String getCharacterEncoding() Implements abstract javax. Doc from javax. Return the character encoding (such as "ISO-8859-1") for this
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements abstract javax. Doc from javax. Return the content type (such as "text/html") for this Note this must not include the "charset=" suffix. | |
| getElementName | back to summary |
|---|---|
| private String getElementName(String name) | |
| getWebConfiguration | back to summary |
|---|---|
| private WebConfiguration getWebConfiguration(WebConfiguration webConfig) | |
| isScriptOrStyle | back to summary |
|---|---|
| private boolean isScriptOrStyle(String name) | |
| isScriptOrStyle | back to summary |
|---|---|
| private boolean isScriptOrStyle() | |
| popElementName | back to summary |
|---|---|
| private String popElementName(String original) | |
| pushElementName | back to summary |
|---|---|
| private String pushElementName(String original) | |
| startCDATA | back to summary |
|---|---|
| public void startCDATA() throws IOException Overrides javax. Starts a CDATA block. Nested blocks are not allowed.
| |
| startDocument | back to summary |
|---|---|
| public void startDocument() throws IOException Implements abstract javax. Write the text that should begin a response.
| |
| startElement | back to summary |
|---|---|
| public void startElement(String name, UIComponent componentForElement) throws IOException Implements abstract javax. Write the start of an element, up to and including the
element name. Clients call
| |
| write | back to summary |
|---|---|
| public void write(char[] cbuf) throws IOException Overrides java. Doc from java. Writes an array of characters.
| |
| write | back to summary |
|---|---|
| public void write(int c) throws IOException Overrides java. Doc from java. Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored. Subclasses that intend to support efficient single-character output should override this method.
| |
| write | back to summary |
|---|---|
| public void write(String str) throws IOException Overrides java. Doc from java. Writes a string.
| |
| write | back to summary |
|---|---|
| public void write(char[] cbuf, int off, int len) throws IOException Implements abstract java. Doc from java. Writes a portion of an array of characters.
| |
| write | back to summary |
|---|---|
| public void write(String str, int off, int len) throws IOException Overrides java. Doc from java. Writes a portion of a string.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String name, Object value, String componentPropertyName) throws IOException Implements abstract javax. Write a properly escaped attribute name and the corresponding
value. The value text will be converted to a String if
necessary. This method may only be called after a call to
| |
| writeComment | back to summary |
|---|---|
| public void writeComment(Object comment) throws IOException Implements abstract javax. Write a comment string containing the specified text.
The text will be converted to a String if necessary.
If there is an open element that has been created by a call
to
| |
| writeEscaped | back to summary |
|---|---|
| private void writeEscaped(char[] cbuf, int offset, int length) throws IOException | |
| writeText | back to summary |
|---|---|
| public void writeText(char text) throws IOException Write a properly escaped single character, If there
is an open element that has been created by a call to
All angle bracket occurrences in the argument must be escaped using the > < syntax.
| |
| writeText | back to summary |
|---|---|
| public void writeText(char[] text) throws IOException Write properly escaped text from a character array.
The output from this command is identical to the invocation:
All angle bracket occurrences in the argument must be escaped using the > < syntax.
| |
| writeText | back to summary |
|---|---|
| public void writeText(Object text, String componentPropertyName) throws IOException Implements abstract javax. Write a properly escaped object. The object will be converted
to a String if necessary. If there is an open element
that has been created by a call to
| |
| writeText | back to summary |
|---|---|
| public void writeText(char[] text, int off, int len) throws IOException Implements abstract javax. Write properly escaped text from a character array.
If there is an open element that has been created by a call
to
All angle bracket occurrences in the argument must be escaped using the > < syntax.
| |
| writeURIAttribute | back to summary |
|---|---|
| public void writeURIAttribute(String name, Object value, String componentPropertyName) throws IOException Implements abstract javax. Write a properly encoded URI attribute name and the corresponding
value. The value text will be converted to a String if necessary).
This method may only be called after a call to
| |
| writeURIAttributeIgnoringPassThroughAttributes | back to summary |
|---|---|
| private void writeURIAttributeIgnoringPassThroughAttributes(String name, Object value, String componentPropertyName, boolean isPassthrough) throws IOException | |