for (int i = 0; i < formElementsList.getLength(); i++) {
Element formElement = (Element) formElementsList.item(i);
String stateName = formElement.getAttribute(STATE_ATTRIBUTE_NAME);
Node node = definition.getNodeByNameNotNull(stateName);
if (node instanceof FormNode) {
FormNode formNode = (FormNode) node;
String typeName = formElement.getAttribute(TYPE_ATTRIBUTE_NAME);
if (!isEmptyOrNull(typeName)) {
formNode.setFormType(typeName);
}
String fileName = formElement.getAttribute(FILE_ATTRIBUTE_NAME);
if (!isEmptyOrNull(fileName)) {
formNode.setFormFileName(fileName);
}
String validationFileName = formElement.getAttribute(VALIDATION_FILE_ATTRIBUTE_NAME);
if (!isEmptyOrNull(validationFileName)) {
formNode.setValidationFileName(validationFileName);
boolean useJsValidation = false;
String useJsAttr = formElement.getAttribute(JS_VALIDATION_ATTRIBUTE_NAME);
if ((useJsAttr != null) && (useJsAttr.length() > 0)) {
useJsValidation = Boolean.parseBoolean(useJsAttr);
}
formNode.setUseJSValidation(useJsValidation);
}
String scriptFileName = formElement.getAttribute(SCRIPT_FILE_ATTRIBUTE_NAME);
if (!isEmptyOrNull(scriptFileName)) {
formNode.setScriptFileName(scriptFileName);
}
}
}
}