01: /*
02: * Copyright (C) 2008 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 04. January 2008 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.converters.basic;
12:
13: /**
14: * Converts the contents of a StringBuilder to XML.
15: *
16: * @author Jörg Schaible
17: */
18: public class StringBuilderConverter extends
19: AbstractSingleValueConverter {
20:
21: public Object fromString(String str) {
22: return new StringBuilder(str);
23: }
24:
25: public boolean canConvert(Class type) {
26: return type.equals(StringBuilder.class);
27: }
28: }
|