if (re instanceof Input)
{
set("type", "input");
Input i = (Input) re;
set("defaultValue", i.getDefaultValue());
Map valids = i.getValidValues();
if (valids.size() > 0)
{
BeanComparator bc = new BeanComparator("value");
TreeSet options = new TreeSet(bc);
DynaProperty[] dpopts = new DynaProperty[2];
dpopts[0] = new DynaProperty("value", Class.forName("java.lang.String"));
dpopts[1] = new DynaProperty("label", Class.forName("java.lang.String"));
DynaClass bdopt = new BasicDynaClass("validValues", Class
.forName("de.iritgo.aktera.clients.MapExposingBasicDynaBean"), dpopts);
Object oneOpt = null;
Object oneLabelObj = null;
for (Iterator io = valids.keySet().iterator(); io.hasNext();)
{
oneOpt = io.next();
DynaBean oneOptBean = bdopt.newInstance();
oneOptBean.set("value", oneOpt.toString());
oneLabelObj = valids.get(oneOpt.toString());
if (oneLabelObj == null)
{
oneLabelObj = "(No Label)";
}
oneOptBean.set("label", oneLabelObj.toString());
options.add(oneOptBean);
}
set("validValues", options);
}
set("label", i.getLabel());
}
if (re instanceof Output)
{
set("type", "output");