xv.text
Class StringEscape

java.lang.Object
  extended by xv.text.StringEscape

public class StringEscape
extends Object

Various string escape methods.

Author:
xv

Constructor Summary
StringEscape()
           
 
Method Summary
static void appendEscapedXML(Appendable dest, CharSequence src)
          Appends the given character sequence, escaped for output into XML.
static void appendEscapedXMLAttribute(Appendable dest, CharSequence src)
          Appends the given character sequence, escaped for output into an XML attribute.
static String escapeXML(CharSequence src)
          Returns the given character sequence, escaped for output into XML.
static String escapeXMLAttribute(CharSequence src)
          Returns the given character sequence, escaped for output into an XML attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringEscape

public StringEscape()
Method Detail

appendEscapedXMLAttribute

public static void appendEscapedXMLAttribute(Appendable dest,
                                             CharSequence src)
                                      throws IOException
Appends the given character sequence, escaped for output into an XML attribute. This only escapes the characters '<', '>', '&', '"', and '\''.

Parameters:
dest - the Appendable to append the escaped text to
src - the character sequence to use as the source
Throws:
IOException - if the given Appendable raises one

appendEscapedXML

public static void appendEscapedXML(Appendable dest,
                                    CharSequence src)
                             throws IOException
Appends the given character sequence, escaped for output into XML. This only escapes the characters '<', '>', and '&'.

Parameters:
dest - the Appendable to append the escaped text to
src - the character sequence to use as the source
Throws:
IOException - if the given Appendable raises one

escapeXMLAttribute

public static String escapeXMLAttribute(CharSequence src)
Returns the given character sequence, escaped for output into an XML attribute. This only escapes the characters '<', '>', '&', '"', and '\''.

Parameters:
src -
See Also:
appendEscapedXMLAttribute(Appendable, CharSequence)

escapeXML

public static String escapeXML(CharSequence src)
Returns the given character sequence, escaped for output into XML. This only escapes the characters '<', '>', and '&'.

Parameters:
dest -
src -


Copyright © 2008-2011. All Rights Reserved.