if (listenersElement != null) {
NodeList list = listenersElement.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
if (list.item(i).getNodeType() == Node.ELEMENT_NODE) {
Element listenerElement = (Element)list.item(i);
WidgetListenerBuilder builder;
try {
builder = (WidgetListenerBuilder) widgetListenerBuilderSelector.select(listenerElement.getLocalName());
} catch (ServiceException e) {
throw new FormsException("Unknown kind of eventlistener '" + listenerElement.getLocalName() + "'.", e,
DomHelper.getLocationObject(listenerElement));
}
WidgetListener listener = builder.buildListener(listenerElement, listenerClass);
widgetListenerBuilderSelector.release(builder);
if (result == null) {
result = new ArrayList();
}
result.add(listener);