text: public final static String htmlEncode(String plainText){if (plainText == null || plainText.length() == 0){return "";}StringBuilder result = new StringBuilder(plainText.length());for (int index=0; index<plainText.length(); index++){char ch = plainText.charAt(index);switch (ch) {case '"':result.append("&quot;");break;case '&':result.append("&amp;");break;case '<':result.append("&lt;");break;case '>':result.append("&gt;");break;case '\'':result.append("&#x27;");break;case '/':result.append("&#x2F;");break;default:result.append(ch);}}return result.toString();}