KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > util > EnumConverter


1 package hudson.util;
2
3 import org.apache.commons.beanutils.Converter;
4
5 /**
6  * {@link Converter} for enums. Used for form binding.
7  * @author Kohsuke Kawaguchi
8  */

9 public class EnumConverter implements Converter {
10     public Object JavaDoc convert(Class JavaDoc aClass, Object JavaDoc object) {
11         return Enum.valueOf(aClass,object.toString());
12     }
13 }
14
Popular Tags