1 7 package com.inversoft.verge.mvc.controller.actionflow.config; 8 9 10 import org.apache.log4j.Logger; 11 import org.jdom.Element; 12 13 import com.inversoft.config.ConfigurationException; 14 import com.inversoft.error.ErrorList; 15 import com.inversoft.util.StringTools; 16 17 18 26 public class ActionHandlerNodeBuilder extends BaseNodeBuilder { 27 28 31 private static final Logger logger = Logger.getLogger(ActionHandlerNodeBuilder.class); 32 33 34 37 public ActionHandlerNodeBuilder() { 38 } 39 40 41 61 public Node build(Namespace namespace, Element element) 62 throws ConfigurationException { 63 64 ErrorList errors = new ErrorList(); 65 BaseNode.BaseValues values = super.buildValues(element, errors); 66 67 if (StringTools.isEmpty(values.name)) { 69 errors.addError(Constants.NAME_ATTRIBUTE + " is a required attribute"); 70 logger.debug("name is null"); 71 } 72 73 if (!(StringTools.isEmpty(values.className) ^ 75 StringTools.isEmpty(values.repositoryId))) 76 { 77 errors.addError("Either the " + Constants.CLASS_ATTRIBUTE + 78 " or the " + Constants.REPOSITORY_ID_ATTRIBUTE + 79 " must be specified and not both"); 80 } 81 82 if (!errors.isEmpty()) { 84 throw new ConfigurationException(errors); 85 } 86 87 BaseNode node = new ActionHandlerNode(values, namespace); 88 node.setElement(element); 89 return node; 90 } 91 } 92 93 | Popular Tags |