if (id != null)
{
if (name != null)
{
throw new ModelException("Both id and name specified for group '" + id + "'");
}
GroupDescriptor group = formular.getGroup(id);
if (group == null)
{
throw new ModelException("Unable to find group '" + id + "'");
}
Configuration[] groupChildren = groupConfig.getChildren();
for (Configuration childConfig : groupChildren)
{
if ("field".equals(childConfig.getName()))
{
String fieldId = childConfig.getAttribute("id", null);
String fieldName = childConfig.getAttribute("id", null);
if (id != null && name != null)
{
throw new ModelException("Both id and name specified for field '" + id + "'");
}
if (id != null)
{
FieldDescriptor field = group.getField(fieldId);
if (field == null)
{
throw new ModelException("Unable to find field '" + fieldId + "' in group '" + id + "'");
}
createCommandsForField(childConfig, formular, field);
}
}