code: public final static void codeEncode(final StringBuilder out, final String value, final int offset)
      {
          for (int i = offset; i < value.length(); i++)
          {
              final char c = value.charAt(i);
              switch (c)
              {
              case '&':
                  out.append("&amp;");
                  break;
              case '<':
                  out.append("&lt;");
                  break;
              case '>':
                  out.append("&gt;");
                  break;
              default:
                  out.append(c);
              }
          }
      }
docs: Appends the given string to the given StringBuilder, replacing '&amp;',
  '&lt;' and '&gt;' by their respective HTML entities.
  
  @param out
  The StringBuilder to append to.
  @param value
  The string to append.
  @param offset
  The character offset into value from where to start