*/
private static Map<String, IODescriptor> readIODefs(Map<String, String> map, String key, boolean input) {
String type;
String inOrOut = input ? "input" : "output";
int count = 0;
IODescriptor desc = null;
Map<String, IODescriptor> defs = new HashMap<String, IODescriptor>(5);
String value = map.get(key + "." + inOrOut + "[" + count + "].name");
while (value != null) {
// Get the type
type = map.get(key + "." + inOrOut + "[" + count + "].type");
if (type == null) {
type = DEFAULT_TYPE;
}
// Create an IODescriptor
desc = new IODescriptor(value, type);
defs.put(value, desc);
// If this is an output, we're done... for input we need to do more
if (input) {
// required?
value = map.get(key + "." + inOrOut + "[" + count + "].required");
if ((value != null) && Boolean.valueOf(value).booleanValue()) {
desc.setRequired(true);
}
// default?
value = map.get(key + "." + inOrOut + "[" + count + "].defaultValue");
if ((value != null) && !value.equals(HandlerInput.DEFAULT_DEFAULT_VALUE)) {
desc.setDefault(value);
}
}
// Look for next IO declaration
value = map.get(key + "." + inOrOut + "[" + (++count) + "].name");