com.missiondata.oss.lakeshore
Class HTMLEscape

java.lang.Object
  extended bycom.missiondata.oss.lakeshore.HTMLEscape

public class HTMLEscape
extends java.lang.Object

This class will escape characters that have an HTML entity representation. It will not escape standard ASCII characters unless it is necessary (i.e. will not escape ASCI #32 but will escape "&"). Any characters with no corresponding entity are passed through unchanged. It uses a quick string -> array mapping to avoid creating thousands of temporary objects.


Constructor Summary
HTMLEscape()
           
 
Method Summary
static java.lang.String escape(java.lang.String nonHTMLsrc)
          This method will take the input and escape characters that have an HTML entity representation.
static void main(java.lang.String[] args)
          A little bit of unit testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLEscape

public HTMLEscape()
Method Detail

main

public static void main(java.lang.String[] args)
A little bit of unit testing


escape

public static final java.lang.String escape(java.lang.String nonHTMLsrc)
This method will take the input and escape characters that have an HTML entity representation. It uses a quick string -> array mapping to avoid creating thousands of temporary objects.

Parameters:
nonHTMLsrc - String containing the text to make HTML-safe
Returns:
String containing new copy of string with entities escaped