1 package com.thoughtworks.xstream.converters.basic;2 3 /**4 * Converts a String to a String ;). Well ok, it doesn't5 * <i>actually</i> do any conversion.6 * <p/>7 * <p>The converter always calls intern() on the returned8 * String to encourage the JVM to reuse instances.</p>9 *10 * @author Joe Walnes11 * @see String#intern()12 */13 public class StringConverter extends AbstractBasicConverter {14 15 public boolean canConvert(Class type) {16 return type.equals(String .class);17 }18 19 protected Object fromString(String str) {20 return str.intern();21 }22 23 }24