if (!FormsConstants.DEFINITION_NS.equals(formElement.getNamespaceURI()) || !formElement.getLocalName().equals("form")) {
throw new FormsException("Expected forms definition <fd:form> element.",
DomHelper.getLocationObject(formElement));
}
FormDefinitionBuilder builder = (FormDefinitionBuilder) widgetDefinitionBuilders.get("form");
if (builder == null) {
throw new Exception("Cannot find FormDefinitionBuilder 'form'");
}
return (FormDefinition) builder.buildWidgetDefinition(formElement);
}