}
DynaClass bdattr = new BasicDynaClass(re.getName() + "_attributes", Class
.forName("de.iritgo.aktera.clients.MapExposingBasicDynaBean"), dattr);
DynaBean oneAttrBean = bdattr.newInstance();
for (Iterator io = attributes.keySet().iterator(); io.hasNext();)
{
oneAttribName = (String) io.next();
oneAttribValue = attributes.get(oneAttribName);
if (oneAttribValue instanceof ResponseElement)
{
oneAttrBean.set(oneAttribName, new ResponseElementDynaBean((ResponseElement) oneAttribValue));
}
else
{
oneAttrBean.set(oneAttribName, oneAttribValue);
}
}
set("attributes", oneAttrBean);
}
else
{
DynaClass bdattr = new BasicDynaClass(re.getName() + "_attributes", Class
.forName("de.iritgo.aktera.clients.MapExposingBasicDynaBean"), new DynaProperty[0]);
BasicDynaBean oneAttrBean = (BasicDynaBean) bdattr.newInstance();
set("attributes", oneAttrBean);
}
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);
}