01: package org.wings.conf;
02:
03: import javax.xml.bind.annotation.adapters.XmlAdapter;
04:
05: /**
06: * <code>StringToClassAdapter<code>.
07: * <p/>
08: * User: rrd
09: * Date: 08.08.2007
10: * Time: 08:55:49
11: *
12: * @author rrd
13: * @version $Id
14: */
15: public class StringToClassAdapter extends XmlAdapter<String, Class> {
16:
17: /**
18: * {@inheritDoc}
19: */
20: public Class unmarshal(String s) throws Exception {
21: return getClass().getClassLoader().loadClass(s);
22: }
23:
24: /**
25: * {@inheritDoc}
26: */
27: public String marshal(Class type) throws Exception {
28: return type.getName();
29: }
30: }
|