question: protected void appendHTML ( final StringBuilder sbuf , final char ch ) { switch ( ch ) { case '<' : sbuf . append ( "&lt;" ) ; break ; case '>' : sbuf . append ( "&gt;" ) ; break ; case '&' : sbuf . append ( "&amp;" ) ; break ; default : sbuf . append ( ch ) ; break ; } }
target:  Append a character to a buffer, escaping HTML meta-characters when needed.