DLESE Tools
v1.2

org.dlese.dpc.util
Class HTMLTools

java.lang.Object
  extended byorg.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

Constructor Summary
HTMLTools()
           
 
Method Summary
static String encodeCharacterEntityReferences(String input, boolean isSGML)
          Encodes a regular String with caracter entity references, for example the ampersand character & becomes &.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLTools

public HTMLTools()
Method Detail

encodeCharacterEntityReferences

public static String encodeCharacterEntityReferences(String input,
                                                     boolean isSGML)
Encodes a regular String with caracter entity references, for example the ampersand character & becomes &amp;. 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.

DLESE Tools
v1.2