com.sun.faces.util
public class HtmlUtils extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
HtmlUtils.MyByteArrayOutputStream
Private implementation of ByteArrayOutputStream.
|
Modifier and Type | Field and Description |
---|---|
private static char |
_LAST_EMPTY_ELEMENT_START |
private static char[] |
AMP_CHARS |
private static java.lang.String[] |
aNames |
private static java.lang.String[] |
bNames |
private static java.lang.String[] |
cNames |
private static char[] |
DEC_REF_START |
private static java.util.BitSet |
DONT_ENCODE_SET |
private static java.lang.String[][] |
emptyElementArr |
private static char[] |
EURO_CHARS |
private static java.lang.String[] |
fNames |
private static char[] |
GT_CHARS |
private static java.lang.String[] |
hNames |
private static java.lang.String[] |
iNames |
private static java.lang.String[] |
lNames |
private static char[] |
LT_CHARS |
private static int |
MAX_BYTES_PER_CHAR |
private static java.lang.String[] |
mNames |
private static java.lang.String[] |
pNames |
private static char[] |
QUOT_CHARS |
private static char[][] |
sISO8859_1_Entities |
private static java.util.Set<java.lang.String> |
UTF_CHARSET |
Modifier | Constructor and Description |
---|---|
private |
HtmlUtils() |
Modifier and Type | Method and Description |
---|---|
private static int |
_writeDecRef(java.io.Writer out,
char[] buffer,
int bufferIndex,
int bufferLength,
char ch)
Writes a character as a decimal escape.
|
private static int |
addToBuffer(java.io.Writer out,
char[] buffer,
int bufferIndex,
int bufferLength,
char ch)
Add a character to the buffer, flushing the buffer if the buffer is
full, and returning the new buffer index
|
private static int |
addToBuffer(java.io.Writer out,
char[] buffer,
int bufferIndex,
int bufferLength,
char[] toAdd)
Add an array of characters to the buffer, flushing the buffer
if the buffer is full, and returning the new buffer index.
|
private static void |
encodeURIString(java.io.Writer out,
char[] textBuff,
java.lang.String encoding,
int start,
int end) |
private static void |
encodeURIString(java.io.Writer out,
java.lang.String text,
java.lang.String encoding,
int start) |
private static int |
flushBuffer(java.io.Writer out,
char[] buffer,
int bufferIndex)
Flush the contents of the buffer to the output stream
and return the reset buffer index
|
private static char |
intToHex(int i) |
private static boolean |
isAmpEscaped(char[] text,
int idx) |
private static boolean |
isAmpEscaped(java.lang.String text,
int idx) |
static boolean |
isEmptyElement(java.lang.String name) |
static boolean |
isISO8859_1encoding(java.lang.String encoding) |
private static boolean |
isPrintableControlChar(int ch) |
static boolean |
isUTFencoding(java.lang.String encoding) |
static boolean |
validateEncoding(java.lang.String encoding) |
static void |
writeAttribute(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buffer,
char[] text) |
static void |
writeAttribute(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buff,
char[] text,
int start,
int length,
boolean isScriptInAttributeValueEnabled)
Write a character array attribute.
|
static void |
writeAttribute(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buff,
java.lang.String text,
char[] textBuff,
boolean isScriptInAttributeValueEnabled)
Write a string attribute.
|
static void |
writeText(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buffer,
char[] text) |
static void |
writeText(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buff,
char[] text,
int start,
int length)
Write char array text.
|
static void |
writeText(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char[] buff,
java.lang.String text,
char[] textBuff)
Write String text.
|
private static int |
writeTextChar(java.io.Writer out,
boolean escapeUnicode,
boolean escapeIsocode,
char ch,
int buffIndex,
char[] buff,
int buffLength) |
static void |
writeTextForXML(java.io.Writer out,
java.lang.String text,
char[] outbuf) |
private static void |
writeURIDoubleHex(java.io.Writer out,
int i) |
static void |
writeURL(java.io.Writer out,
char[] textBuff,
int start,
int len,
java.lang.String queryEncoding)
Writes a string into URL-encoded format out to a Writer.
|
static void |
writeURL(java.io.Writer out,
java.lang.String text,
char[] textBuff,
java.lang.String queryEncoding)
Writes a string into URL-encoded format out to a Writer.
|
private static final java.util.Set<java.lang.String> UTF_CHARSET
private static final char[] AMP_CHARS
private static final char[] QUOT_CHARS
private static final char[] GT_CHARS
private static final char[] LT_CHARS
private static final char[] EURO_CHARS
private static final char[] DEC_REF_START
private static final int MAX_BYTES_PER_CHAR
private static final java.util.BitSet DONT_ENCODE_SET
private static char[][] sISO8859_1_Entities
private static char _LAST_EMPTY_ELEMENT_START
private static java.lang.String[][] emptyElementArr
private static java.lang.String[] aNames
private static java.lang.String[] bNames
private static java.lang.String[] cNames
private static java.lang.String[] fNames
private static java.lang.String[] hNames
private static java.lang.String[] iNames
private static java.lang.String[] lNames
private static java.lang.String[] mNames
private static java.lang.String[] pNames
public static void writeText(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buffer, char[] text) throws java.io.IOException
java.io.IOException
public static void writeText(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buff, char[] text, int start, int length) throws java.io.IOException
java.io.IOException
public static void writeText(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buff, java.lang.String text, char[] textBuff) throws java.io.IOException
java.io.IOException
private static int writeTextChar(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char ch, int buffIndex, char[] buff, int buffLength) throws java.io.IOException
java.io.IOException
public static void writeAttribute(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buff, java.lang.String text, char[] textBuff, boolean isScriptInAttributeValueEnabled) throws java.io.IOException
java.io.IOException
public static void writeAttribute(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buffer, char[] text) throws java.io.IOException
java.io.IOException
public static void writeAttribute(java.io.Writer out, boolean escapeUnicode, boolean escapeIsocode, char[] buff, char[] text, int start, int length, boolean isScriptInAttributeValueEnabled) throws java.io.IOException
java.io.IOException
private static boolean isPrintableControlChar(int ch)
private static int _writeDecRef(java.io.Writer out, char[] buffer, int bufferIndex, int bufferLength, char ch) throws java.io.IOException
java.io.IOException
private static int addToBuffer(java.io.Writer out, char[] buffer, int bufferIndex, int bufferLength, char ch) throws java.io.IOException
java.io.IOException
private static int addToBuffer(java.io.Writer out, char[] buffer, int bufferIndex, int bufferLength, char[] toAdd) throws java.io.IOException
java.io.IOException
private static int flushBuffer(java.io.Writer out, char[] buffer, int bufferIndex) throws java.io.IOException
java.io.IOException
public static void writeURL(java.io.Writer out, java.lang.String text, char[] textBuff, java.lang.String queryEncoding) throws java.io.IOException, java.io.UnsupportedEncodingException
NOTE: This is method is duplicated below. The difference being the acceptance of a char[] for the text to write. Any changes made here, should be made below.
out
- a Writer for the outputtext
- the unencoded (or partially encoded) StringqueryEncoding
- the character set encoding for after the first
question markjava.io.IOException
java.io.UnsupportedEncodingException
public static void writeURL(java.io.Writer out, char[] textBuff, int start, int len, java.lang.String queryEncoding) throws java.io.IOException, java.io.UnsupportedEncodingException
NOTE: This is method is duplicated above. The difference being the acceptance of a String for the text to write. Any changes made here, should be made above.
out
- a Writer for the outputtextBuff
- char[] containing the content to writequeryEncoding
- the character set encoding for after the first
question markjava.io.IOException
java.io.UnsupportedEncodingException
public static void writeTextForXML(java.io.Writer out, java.lang.String text, char[] outbuf) throws java.io.IOException
java.io.IOException
private static void encodeURIString(java.io.Writer out, java.lang.String text, java.lang.String encoding, int start) throws java.io.IOException
java.io.IOException
private static void encodeURIString(java.io.Writer out, char[] textBuff, java.lang.String encoding, int start, int end) throws java.io.IOException
java.io.IOException
private static boolean isAmpEscaped(java.lang.String text, int idx)
private static boolean isAmpEscaped(char[] text, int idx)
private static void writeURIDoubleHex(java.io.Writer out, int i) throws java.io.IOException
java.io.IOException
private static char intToHex(int i)
public static boolean validateEncoding(java.lang.String encoding)
public static boolean isISO8859_1encoding(java.lang.String encoding)
public static boolean isUTFencoding(java.lang.String encoding)
public static boolean isEmptyElement(java.lang.String name)
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.