/*
   * (non-Javadoc)
   *
   * @see gov.nih.nci.codegen.core.JDOMConfigurable#configure(org.jdom.Element)
   */
  public void configure(org.w3c.dom.Element config) throws ConfigurationException {

    org.w3c.dom.Element filterEl = XMLUtils.getChild(config, "filter");
    if (filterEl == null) {
      log.error("no child filter element found");
      throw new ConfigurationException("no child filter element found");
    }

    String className = filterEl.getAttribute("className");
    if (className == null) {
      log.error("no filter class name specified");
      throw new ConfigurationException("no filter class name specified");
    }
    _pkgName = getParameter(config, "basePackage");
    log.debug("basePackage: " + _pkgName);
    _fileSuffix = getParameter(config, "fileSuffix");

    try {
      _classifierFilt = (UML13ClassifierFilter) Class.forName(className).newInstance();
    } catch (Exception ex) {
      log.error("Couldn't instantiate " + className);
      throw new ConfigurationException("Couldn't instantiate " + className);
    }

    _classifierFilt.configure(filterEl);
  }
  private String getParameter(org.w3c.dom.Element config, String paramName) {
    String param = null;

    List params = XMLUtils.getChildren(config, "param");
    for (Iterator i = params.iterator(); i.hasNext(); ) {
      org.w3c.dom.Element paramEl = (org.w3c.dom.Element) i.next();
      if (paramName.equals(paramEl.getAttribute("name"))) {
        param = paramEl.getAttribute("value");
        break;
      }
    }

    return param;
  }