* @return an instance of Input.
*/
@SuppressWarnings("unchecked")
private Input createInput(OMElement inputElement) {
Input input = new Input();
OMAttribute typeAttr = inputElement.getAttribute(ATTR_TYPE);
if (null == typeAttr || null == typeAttr.getAttributeValue()) {
input.setName(inputElement.getAttribute(ATTR_NAME)
.getAttributeValue());
input.setRequired(Boolean.parseBoolean(null != inputElement
.getAttribute(ATTR_REQUIRED) ? inputElement.getAttribute(
ATTR_REQUIRED).getAttributeValue() : "false"));
} else {
input.setType(typeAttr.getAttributeValue());
OMAttribute nameAttr = inputElement.getAttribute(ATTR_NAME);
if(nameAttr!=null && nameAttr.getAttributeValue()!=null){
input.setName(nameAttr.getAttributeValue());
}
for (Iterator<OMElement> itr = inputElement
.getChildrenWithName(ELEM_INPUT); itr.hasNext();) {
input.getSubInputs().add(createInput(itr.next()));
}
}
return input;
}