Java Utililty Methods HTML

List of utility methods to do HTML

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

Description

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

Method

String htmlBlock(String labelText)
html Block
return "<html>" + labelText + "</html>";
String htmlBold(String content)
html Bold
return "<b>" + content + "</b>";
String htmlButton(String value, String action, int width)
Method htmlButton.
return htmlButton(value, action, width, 22);
boolean HTMLcheck(String doc)
HTM Lcheck
if (doc == null)
 return false;
if (doc.substring(0, 5).equals("<html"))
 return true;
if (doc.substring(0, 5).equals("<HTML"))
 return true;
if (doc.substring(0, 14).equals("<!DOCTYPE HTML"))
 return true;
...
String htmlCode(char tok)
html Code
int i = 0;
for (; i < HTML.length; i++) {
 if (HTML[i][0].equals(tok + "")) {
 return HTML[i][1];
return tok + "";
String htmlcodeToSpecialchars(String str)
htmlcode To Specialchars
str = str.replaceAll("&", "&");
str = str.replaceAll(""", "\"");
str = str.replaceAll("'", "'");
str = str.replaceAll("<", "<");
str = str.replaceAll(">", ">");
return str;
String htmlcodeToSpecialchars(String str)
htmlcode To Specialchars
str = str.replaceAll("&", "&");
str = str.replaceAll(""", "\"");
str = str.replaceAll("'", "'");
str = str.replaceAll("<", "<");
str = str.replaceAll(">", ">");
return str;
String htmlContentHeaderGen(String providerNo, String output, String errorMsg)
html Content Header Gen
StringBuilder htmlContentHeader = new StringBuilder();
htmlContentHeader.append(
 "<html><body><style type='text/css'><!-- .bodytext{ font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #003366; text-decoration: none; --></style>");
htmlContentHeader.append("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
htmlContentHeader.append("<tr>");
htmlContentHeader
 .append("<td colspan='4' class='bodytext'>Billing Invoice for Billing No." + providerNo + "</td>");
htmlContentHeader.append("<td colspan='7' class='bodytext'>Payment date of " + output + "</td>");
...
String htmlConvert(String htmlStr)
html Convert
if (htmlStr == null)
 return "";
htmlStr = htmlStr.replaceAll("&", "&");
htmlStr = htmlStr.replaceAll(" ", " ");
htmlStr = htmlStr.replaceAll("\"", """);
htmlStr = htmlStr.replaceAll("<", "<");
htmlStr = htmlStr.replaceAll(">", ">");
htmlStr = htmlStr.replaceAll("\r\n", "<br>");
...
String HTMLEnc(String s)
HTML encoding (does not convert line breaks).
return XMLEncNA(s);


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