org.dlese.dpc.util
Class HTMLTools
java.lang.Object
org.dlese.dpc.util.HTMLTools
- public class HTMLTools
- extends Object
This class holds a number of handy static methods for use in HTML and XML processing.
- Author:
- John Weatherley
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTMLTools
public HTMLTools()
encodeCharacterEntityReferences
public static String encodeCharacterEntityReferences(String input,
boolean isSGML)
- Encodes a regular String with caracter entity references, for example the ampersand
character & becomes &. See Entities Reference for
a nice table of character entity references. Ampersands that are already encoded will
not be touched. If the input string is an SGML variant like HTML or XML then all
occurances of the characters <, > and " are left alone.
- Parameters:
input
- A String.isSGML
- True if the input string is a an SGML variant such as HTML or XML,
false if not.
- Returns:
- A String that is encoded with character entity references.