org.vivoweb.harvester.util
Class SpecialEntities

java.lang.Object
  extended by org.vivoweb.harvester.util.SpecialEntities

public class SpecialEntities
extends java.lang.Object

Author:
Christopher Haines (hainesc@ctrip.ufl.edu)

Constructor Summary
SpecialEntities()
           
 
Method Summary
static java.lang.String htmlDecode(java.lang.String s)
          Converts all HTML-special-character-entities to special characters
static java.lang.String htmlEncode(java.lang.String s, char... exceptions)
          Converts all special characters to HTML-entities
static java.lang.String xmlDecode(java.lang.String s)
          Converts all XML-special-character-entities to special characters
static java.lang.String xmlEncode(java.lang.String s, char... exceptions)
          Converts all special characters to XML-entities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecialEntities

public SpecialEntities()
Method Detail

htmlEncode

public static java.lang.String htmlEncode(java.lang.String s,
                                          char... exceptions)
Converts all special characters to HTML-entities

Parameters:
s - input string
exceptions - force these characters to be encoded
Returns:
html encoded string

htmlDecode

public static java.lang.String htmlDecode(java.lang.String s)
Converts all HTML-special-character-entities to special characters

Parameters:
s - input string
Returns:
html decoded string

xmlEncode

public static java.lang.String xmlEncode(java.lang.String s,
                                         char... exceptions)
Converts all special characters to XML-entities

Parameters:
s - input string
exceptions - force these characters to be encoded
Returns:
xml encoded string

xmlDecode

public static java.lang.String xmlDecode(java.lang.String s)
Converts all XML-special-character-entities to special characters

Parameters:
s - input string
Returns:
xml decoded string