1 16 package org.apache.cocoon.woody.formmodel; 17 18 import org.apache.cocoon.woody.Constants; 19 import org.apache.cocoon.woody.util.DomHelper; 20 import org.w3c.dom.Element ; 21 22 28 public class ClassDefinitionBuilder extends AbstractWidgetDefinitionBuilder { 29 30 public WidgetDefinition buildWidgetDefinition(Element element) throws Exception { 31 ClassDefinition definition = new ClassDefinition(); 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 |