01: package org.compass.core.test.managedidconverter;
02:
03: import org.compass.core.converter.ConversionException;
04: import org.compass.core.converter.basic.AbstractBasicConverter;
05: import org.compass.core.mapping.ResourcePropertyMapping;
06: import org.compass.core.marshall.MarshallingContext;
07:
08: /**
09: * @author kimchy
10: */
11: public class SimpleConverter extends AbstractBasicConverter {
12:
13: protected String doToString(Object o,
14: ResourcePropertyMapping resourcePropertyMapping,
15: MarshallingContext context) {
16: return "X" + o.toString();
17: }
18:
19: protected Object doFromString(String str,
20: ResourcePropertyMapping resourcePropertyMapping,
21: MarshallingContext context) throws ConversionException {
22: return str.substring(1, str.length());
23: }
24: }
|