01: /*
02: * Copyright (C) 2006, 2007 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 15. February 2006 by Mauro Talevi
10: */
11: package com.thoughtworks.xstream.converters;
12:
13: /**
14: * SingleValueConverter implementations are marshallable to/from a single value String representation.
15: * <p/>
16: * <p>{@link com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter}
17: * provides a starting point for objects that can store all information in a single value String.</p>
18: *
19: * @author Joe Walnes
20: * @author Jörg Schaible
21: * @author Mauro Talevi
22: * @see com.thoughtworks.xstream.converters.Converter
23: * @see com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
24: * @since 1.2
25: */
26: public interface SingleValueConverter extends ConverterMatcher {
27:
28: /**
29: * Marshals an Object into a single value representation.
30: * @param obj the Object to be converted
31: * @return a String with the single value of the Object or <code>null</code>
32: */
33: public String toString(Object obj);
34:
35: /**
36: * Unmarshals an Object from its single value representation.
37: * @param str the String with the single value of the Object
38: * @return the Object
39: */
40: public Object fromString(String str);
41:
42: }
|