Does java have a built in way to convert angle-brackets to entity codes?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1265282/recommended-method-for-escaping-html-in-java">Recommended method for escaping HTML in Java</a><br>
  <a href="http://stackoverflow.com/questions/10978098/replace-characters-with-html-entities-in-java">Replace characters with HTML entities in java</a>  </p>
</blockquote>



<p>I have some java code which writes text including angle-brackets to a DB; this text is displayed on a web-page.</p>

<p>Rather than change my java code to be full of entity codes, I wondered if I can keep the constants like "<code>&lt;test&gt;</code>" and use a standard library function to generate the entity-based string "<code>&amp;lt;test&amp;gt;</code>"?</p>
