Java Utililty Methods HTML Decode

List of utility methods to do HTML Decode

  1. HOME
  2. Java
  3. H
  4. HTML Decode

Description

The list of methods to do HTML Decode are organized into topic(s).

Method

String HTMLDecode(String s)
HTML Decode
String mine = s;
for (int i = 0; i < c.length; i++) {
 mine.replaceAll(expansion[i], (c[i] + ""));
return mine;
String htmlDecode(String s)
html Decode
if (s == null || s.length() == 0) {
 return s;
s = s.replace(" ", " ");
s = s.replace(""", "\"");
s = s.replace("'", "'");
s = s.replace("'", "'");
s = s.replace("<", "<");
...
String htmlDecode(String strSrc)
html Decode
if (strSrc == null) {
 return "";
strSrc = strSrc.replaceAll("<", "<");
strSrc = strSrc.replaceAll(">", ">");
strSrc = strSrc.replaceAll(""", "\"");
strSrc = strSrc.replaceAll("'", "'");
strSrc = strSrc.replaceAll("&", "&");
...
String htmlDecoder(String content)
html Decoder
if (content == null) {
 return "";
content = content.replaceAll("<br>", "");
content = content.replaceAll("\n", "");
content = content.replaceAll("\r", "");
content = content.replaceAll("<", "");
content = content.replaceAll(">", "");
...
String htmlEntityDecode(String s)
the following method was taken from suns Decoder and stands under CDDL look here for a converter: http://gmailassistant.sourceforge.net/src/org/freeshell/zs/common/HtmlManipulator.java.html
int i = 0, j = 0, pos = 0;
StringBuffer sb = new StringBuffer();
while ((i = s.indexOf("&", pos)) != -1 && (j = s.indexOf(';', i)) != -1) {
 int n = -1;
 for (i += 1; i < j; ++i) {
 char c = s.charAt(i);
 if ('0' <= c && c <= '9')
 n = (n == -1 ? 0 : n * 10) + c - '0';
...
String htmlEntityDecodeSingle(String s)
html Entity Decode Single
int i = 0, j = 0, pos = 0;
StringBuffer sb = new StringBuffer();
while ((i = s.indexOf("&#", pos)) != -1 && (j = s.indexOf(';', i)) != -1) {
 int n = -1;
 for (i += 2; i < j; ++i) {
 char c = s.charAt(i);
 if ('0' <= c && c <= '9')
 n = (n == -1 ? 0 : n * 10) + c - '0';
...
String toHtmlString(String src, boolean noSingleQuotes)
to Html String
StringCharacterIterator iter = new StringCharacterIterator(src);
StringBuffer buf = new StringBuffer();
for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
 switch (c) {
 case '\'':
 if (noSingleQuotes) {
 buf.append(c);
 } else {
...


AltStyle によって変換されたページ (->オリジナル) /