throw new InvalidModuleException("Invalid parameter: missing required 'name' attribute");
else
paramName = nameAttribute.getValue();
//create:
BasicParameter param = new BasicParameter(paramName, type);
List children = element.getChildren();
for (int i=0; i<children.size(); i++) {
Element child = (Element)children.get(i);
String name = child.getName().toLowerCase();
if (name.equals("title"))
param.setTitle(child.getText());
else if (name.equals("help"))
param.setHelp(child.getText());
else if (name.equals("options")) {
ListSerializer serializer = new ListSerializer(
new OptionSerializer(), "option");
param.setOptionList(serializer.readList(child));
}
else if (name.equals("default"))
param.setDefault(child.getText());
else if (name.equals("scriptlet"))
param.setScriptlet(child.getText());
}
//assume parameter is required if no scriptlet is present:
param.setNullScriptlet(
param.hasScriptlet() ?
"" : null
);
return param;
}