FileDocCategorySizeDatePackage
EnumTypeConverter.javaAPI DocApache Struts 2.0.9 Apps2008Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.conversion

EnumTypeConverter

public class EnumTypeConverter extends org.apache.struts2.util.StrutsTypeConverter
version
$Date: 2006-11-23 12:31:52 -0500 (Thu, 23 Nov 2006) $ $Id: EnumTypeConverter.java 478625 2006-11-23 17:31:52Z wsmoak $

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectconvertFromString(java.util.Map context, java.lang.String[] values, java.lang.Class toClass)

        List<Enum> result = new ArrayList<Enum>();
        for (int a=0; a< values.length; a++) {
            Enum e = Enum.valueOf(OperationsEnum.class, values[a]);
            if (e != null)
                result.add(e);
        }
        return result;
    
public java.lang.StringconvertToString(java.util.Map context, java.lang.Object o)

        List l = (List) o;
        String result ="<";
        for (Iterator i = l.iterator(); i.hasNext(); ) {
            result = result + "["+ i.next() +"]";
        }
        result = result+">";
        return result;