FileDocCategorySizeDatePackage
HTMLFilter.javaAPI DocAndroid 1.5 API1534Wed May 06 22:41:06 BST 2009org.bouncycastle.i18n.filter

HTMLFilter

public class HTMLFilter extends Object implements Filter
HTML Filter

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringdoFilter(java.lang.String input)

        StringBuffer buf = new StringBuffer(input);
        int i = 0;
        while (i < buf.length()) 
        {
            char ch = buf.charAt(i);
            switch (ch)
            {
            case '<":
                buf.replace(i,i+1,"<");
                break;
            case '>":
                buf.replace(i,i+1,">");
                break;
            case '(":
                buf.replace(i,i+1,"(");
                break;
            case ')":
                buf.replace(i,i+1,")");
                break;
            case '#":
                buf.replace(i,i+1,"#");
                break;
            case '&":
                buf.replace(i,i+1,"&");
                break;
            case '\"":
                buf.replace(i,i+1,""");
                break;
            case '\'":
                buf.replace(i,i+1,"'");
                break;
            case '%":
                buf.replace(i,i+1,"%");
                break;
            case ';":
                buf.replace(i,i+1,";");
                break;
            case '+":
                buf.replace(i,i+1,"+");
                break;
            case '-":
                buf.replace(i,i+1,"-");
                break;
            default:
                i -= 3;
            }
            i += 4;
        }
        return buf.toString();