commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smith, Pamela" <>
Subject Betwixt - Converting Strings to Objects
Date Wed, 10 Mar 2004 19:52:55 GMT
How do I convert a String to an Object during parsing?  I registered the converter in ConvertUtils
but betwixt never calls its convert method.  I've also tried plugging in a custom ObjectStringConverter
to the reader's BindingConfiguration but the stringToObject method is not called for the registered
class.  Thanks for any help.

class MyConverter implements Converter
   public Object convert(Class aClass, Object o)
      if (KeyStroke.class.equals(aClass))
         return KeyStroke.getKeyStroke((String)o);

ConvertUtils.register(new MyConverter(), KeyStroke.class);
BeanReader reader = new BeanReader();
reader.parse ...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message