com.dtolabs.utils
Class XmlEncoder

java.lang.Object
  extended by com.dtolabs.utils.XmlEncoder

public class XmlEncoder
extends java.lang.Object

Provides a basic encode/decode methods to handle characters harmful to XML documents.


Constructor Summary
XmlEncoder()
           
 
Method Summary
static java.lang.String decode(java.lang.String s)
          Takes input string and replaces all occurrences of the escaped charcter sequences and returns back 'harmful' XML characters.
static java.lang.String encode(java.lang.String s)
          Takes input string and replaces all occurrences of the following characters with the escaped counterparts: &, <, >, ', \t, \n, \r, "
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlEncoder

public XmlEncoder()
Method Detail

encode

public static java.lang.String encode(java.lang.String s)
Takes input string and replaces all occurrences of the following characters with the escaped counterparts: &, <, >, ', \t, \n, \r, "

Parameters:
s - a String input value
Returns:
a String output value

decode

public static java.lang.String decode(java.lang.String s)
Takes input string and replaces all occurrences of the escaped charcter sequences and returns back 'harmful' XML characters.

Parameters:
s - a String input value
Returns:
a String output value