Class XmlFriendlyReplacer

java.lang.Object
com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder
com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer
All Implemented Interfaces:
NameCoder, Cloneable
Direct Known Subclasses:
XStream11XmlFriendlyReplacer

public class XmlFriendlyReplacer extends XmlFriendlyNameCoder
Deprecated.
As of 1.4, use XmlFriendlyNameCoder instead
Allows replacement of Strings in XML-friendly drivers. The default replacements are:
  • $ (dollar) chars are replaced with _- (underscore dash) string.
  • _ (underscore) chars are replaced with __ (double underscore) string.
Since:
1.2
  • Constructor Details

    • XmlFriendlyReplacer

      public XmlFriendlyReplacer()
      Deprecated.
      As of 1.4, use XmlFriendlyNameCoder instead
      Default constructor.
    • XmlFriendlyReplacer

      public XmlFriendlyReplacer(String dollarReplacement, String underscoreReplacement)
      Deprecated.
      As of 1.4, use XmlFriendlyNameCoder instead
      Creates an XmlFriendlyReplacer with custom replacements
      Parameters:
      dollarReplacement - the replacement for '$'
      underscoreReplacement - the replacement for '_'
  • Method Details

    • escapeName

      public String escapeName(String name)
      Deprecated.
      As of 1.4, use XmlFriendlyNameCoder instead
      Escapes name substituting '$' and '_' with replacement strings
      Parameters:
      name - the name of attribute or node
      Returns:
      The String with the escaped name
    • unescapeName

      public String unescapeName(String name)
      Deprecated.
      As of 1.4, use XmlFriendlyNameCoder instead
      Unescapes name re-enstating '$' and '_' when replacement strings are found
      Parameters:
      name - the name of attribute or node
      Returns:
      The String with unescaped name