public String htmlEncode(Object object){
  return object != null ? StringEscapeUtils.escapeHtml4(String.valueOf(object)) : null;
}

public String htmlEncode ( Object object ) { return object != null ? StringEscapeUtils . escapeHtml4 ( String . valueOf ( object ) ) : null ; }
html - escapes the string representation of the given object .
