1 16 package org.apache.cocoon.woody.formmodel; 17 18 import org.w3c.dom.Element ; 19 import org.apache.cocoon.woody.Constants; 20 import org.apache.cocoon.woody.util.DomHelper; 21 22 28 public class StructDefinitionBuilder extends AbstractWidgetDefinitionBuilder { 29 30 public WidgetDefinition buildWidgetDefinition(Element element) throws Exception { 31 StructDefinition definition = new StructDefinition(); 32 setLocation(element, definition); 33 setId(element, definition); 34 setDisplayData(element, definition); 35 setValidators(element, definition); 36 37 Element widgetsElement = DomHelper.getChildElement(element, Constants.WD_NS, "widgets", true); 38 Element [] widgetElements = DomHelper.getChildElements(widgetsElement, Constants.WD_NS); 40 for (int i = 0; i < widgetElements.length; i++) { 41 Element widgetElement = widgetElements[i]; 42 WidgetDefinition widgetDefinition = buildAnotherWidgetDefinition(widgetElement); 43 definition.addWidgetDefinition(widgetDefinition); 44 } 45 46 return definition; 47 } 48 } 49 | Popular Tags |