com.thoughtworks.xstream.converters.basic
Class StringConverter

java.lang.Object
  extended bycom.thoughtworks.xstream.converters.basic.AbstractBasicConverter
      extended bycom.thoughtworks.xstream.converters.basic.StringConverter
All Implemented Interfaces:
Converter

public class StringConverter
extends AbstractBasicConverter

Converts a String to a String ;). Well ok, it doesn't actually do any conversion.

The converter always calls intern() on the returned String to encourage the JVM to reuse instances.

Author:
Joe Walnes
See Also:
String.intern()

Constructor Summary
StringConverter()
           
 
Method Summary
 boolean canConvert(java.lang.Class type)
          Called by XStream to determine whether to use this converter instance to marshall a particular type.
protected  java.lang.Object fromString(java.lang.String str)
           
 
Methods inherited from class com.thoughtworks.xstream.converters.basic.AbstractBasicConverter
marshal, toString, unmarshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConverter

public StringConverter()
Method Detail

canConvert

public boolean canConvert(java.lang.Class type)
Description copied from interface: Converter
Called by XStream to determine whether to use this converter instance to marshall a particular type.

Specified by:
canConvert in interface Converter
Specified by:
canConvert in class AbstractBasicConverter

fromString

protected java.lang.Object fromString(java.lang.String str)
Specified by:
fromString in class AbstractBasicConverter


Joe Walnes, http://xstream.codehaus.org/