Example #1
0
 public org.w3c.dom.Text getTextNode(Document ownerDoc) {
   // XXX Current XMLUtil.write anyway does not preserve CDATA sections, it seems.
   String nocdata = getProject().getProperty("makenbm.nocdata");
   if (nocdata != null && Project.toBoolean(nocdata)) {
     return ownerDoc.createTextNode(text.toString());
   } else {
     return ownerDoc.createCDATASection(text.toString());
   }
 }
 /**
  * When using this as a custom selector, this method will be called. It translates each parameter
  * into the appropriate setXXX() call.
  *
  * @param parameters the complete set of parameters for this selector
  */
 public void setParameters(Parameter[] parameters) {
   super.setParameters(parameters);
   if (parameters != null) {
     for (int i = 0; i < parameters.length; i++) {
       String paramname = parameters[i].getName();
       if (EXPRESSION_KEY.equalsIgnoreCase(paramname)) {
         setExpression(parameters[i].getValue());
       } else if (CS_KEY.equalsIgnoreCase(paramname)) {
         setCaseSensitive(Project.toBoolean(parameters[i].getValue()));
       } else if (ML_KEY.equalsIgnoreCase(paramname)) {
         setMultiLine(Project.toBoolean(parameters[i].getValue()));
       } else if (SL_KEY.equalsIgnoreCase(paramname)) {
         setSingleLine(Project.toBoolean(parameters[i].getValue()));
       } else {
         setError("Invalid parameter " + paramname);
       }
     }
   }
 }
Example #3
0
 /** Parses the parameters to add user-defined contains strings. */
 private void initialize() {
   Parameter[] params = getParameters();
   if (params != null) {
     for (int i = 0; i < params.length; i++) {
       if (CONTAINS_KEY.equals(params[i].getType())) {
         contains.addElement(params[i].getValue());
       } else if (NEGATE_KEY.equals(params[i].getType())) {
         setNegate(Project.toBoolean(params[i].getValue()));
       }
     }
   }
 }
Example #4
0
 public void importSpkInfo(Map<String, Object> info, String key, String value) {
   switch (key) {
     case "package":
     case "version":
     case "maintainer":
     case "maintainer_url":
     case "distributor":
     case "distributor_url":
       info.put(key, value);
       break;
     case "displayname":
       info.put("dname", value);
       break;
     case "description":
       info.put("desc", value);
       break;
     case "install_dep_packages":
       info.put("deppkgs", value);
       break;
     case "install_dep_services":
       info.put("depsers", value);
       break;
     case "startable":
       info.put("start", Project.toBoolean(value));
       info.put("qstart", Project.toBoolean(value));
       break;
     case "silent_install":
       info.put("qinst", Project.toBoolean(value));
       break;
     case "silent_upgrade":
       info.put("qupgrade", Project.toBoolean(value));
       break;
     case "thirdparty":
       info.put(key, Project.toBoolean(value));
       break;
   }
 }
Example #5
0
  /**
   * init-Method sets defaults from Properties. That way, when ant is called with arguments like
   * -Dant.netrexxc.verbose=verbose5 one can easily take control of all netrexxc-tasks.
   */
  public void init() {
    String p;

    if ((p = getProject().getProperty("ant.netrexxc.binary")) != null) {
      this.binary = Project.toBoolean(p);
    }
    // classpath makes no sense
    if ((p = getProject().getProperty("ant.netrexxc.comments")) != null) {
      this.comments = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.compact")) != null) {
      this.compact = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.compile")) != null) {
      this.compile = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.console")) != null) {
      this.console = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.crossref")) != null) {
      this.crossref = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.decimal")) != null) {
      this.decimal = Project.toBoolean(p);
      // destDir
    }
    if ((p = getProject().getProperty("ant.netrexxc.diag")) != null) {
      this.diag = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.explicit")) != null) {
      this.explicit = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.format")) != null) {
      this.format = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.keep")) != null) {
      this.keep = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.logo")) != null) {
      this.logo = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.replace")) != null) {
      this.replace = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.savelog")) != null) {
      this.savelog = Project.toBoolean(p);
      // srcDir
    }
    if ((p = getProject().getProperty("ant.netrexxc.sourcedir")) != null) {
      this.sourcedir = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictargs")) != null) {
      this.strictargs = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictassign")) != null) {
      this.strictassign = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictcase")) != null) {
      this.strictcase = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictimport")) != null) {
      this.strictimport = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictprops")) != null) {
      this.strictprops = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.strictsignal")) != null) {
      this.strictsignal = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.symbols")) != null) {
      this.symbols = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.time")) != null) {
      this.time = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.trace")) != null) {
      setTrace(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.utf8")) != null) {
      this.utf8 = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.verbose")) != null) {
      setVerbose(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.suppressMethodArgumentNotUsed")) != null) {
      this.suppressMethodArgumentNotUsed = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.suppressPrivatePropertyNotUsed")) != null) {
      this.suppressPrivatePropertyNotUsed = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.suppressVariableNotUsed")) != null) {
      this.suppressVariableNotUsed = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.suppressExceptionNotSignalled")) != null) {
      this.suppressExceptionNotSignalled = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.suppressDeprecation")) != null) {
      this.suppressDeprecation = Project.toBoolean(p);
    }
    if ((p = getProject().getProperty("ant.netrexxc.removeKeepExtension")) != null) {
      this.removeKeepExtension = Project.toBoolean(p);
    }
  }