Java Utililty Methods HTML

List of utility methods to do HTML

Description

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

Method

intHTMLtoRGB(String htmlColor)
Parses HTML color representation
return Integer.parseInt(htmlColor.replace("#", ""), 16);
byte[]HTMLToTriplet(String color)
HTML To Triplet
final int offset = color.charAt(0) == '#' ? 1 : 0;
final short red = Short.parseShort(color.substring(offset + 0, offset + 2), 16); 
final short green = Short.parseShort(color.substring(offset + 2, offset + 4), 16); 
final short blue = Short.parseShort(color.substring(offset + 4, offset + 6), 16); 
final byte r = (byte) (red & 0xff);
final byte g = (byte) (green & 0xff);
final byte b = (byte) (blue & 0xff);
return new byte[] { r, g, b };
...
StringhtmlWrap(String text)
html Wrap
String s = text.replaceAll(String.valueOf(WRAPPING_BREAK), HTML_BREAK);
return s.replaceAll(" ", NBSP);
StringBuilderhtmlWrap(StringBuilder s)
html Wrap
s.insert(0, "<html>").append("</html>");
return s;