public void copyFrom(ModelResponse res) throws ModelException
{
assert res != null;
originalRes = res;
ResponseElement oneElement = null;
for (Iterator ie = res.getAll(); ie.hasNext();)
{
oneElement = (ResponseElement) ie.next();
if (oneElement instanceof Command)
{
add(new CommandMessage((Command) oneElement));
}
else if (oneElement instanceof Input)
{
add(new InputMessage((Input) oneElement));
}
else if (oneElement instanceof Output)
{
add(new OutputMessage((Output) oneElement));
}
else
{
throw new ModelException("Element " + oneElement.getName() + " is of an unknown type: "
+ oneElement.getClass().getName() + "'");
}
}
/* Attributes must be either ResponseElements, or basic Java types */
String oneAttribName = null;