Package gri.gridp.modules

Examples of gri.gridp.modules.Parameter


  public Object read(Element elem) throws IOException {
    return readList(elem);
  }

  public void writeList(List list, Element elem) throws IOException {
    Parameter param;
    for (int i=0; i<list.size(); i++) {
      param = (Parameter)list.get(i);

      if (param instanceof Flag) {
        Element child = new Element("flag");
View Full Code Here


    List children = elem.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      Parameter param = serializer.readParameter(child);
      list.add(param);
    }

    return list;
  }
View Full Code Here

    if (refAttribute != null) {
      String ref = refAttribute.getValue();
      if (globalParams == null)
        throw new InvalidModuleException("Reference to parameter '" + ref + "' was made, but no parameter map was supplied");

      Parameter param = (Parameter)globalParams.get(ref);
      if (param == null)
        throw new InvalidModuleException("Reference to parameter '" + ref + "' was made, but parameter was not found in supplied parameter list");
      else
        return (Parameter)param.clone();
    }

    //type:
    String nodeName = element.getName().toLowerCase();
    String type = "string"//default
View Full Code Here

      }

      else if (name.equals("parameters")) {
        List parameters = paramSerializer.readList(child);
        for (int j = 0; j < parameters.size(); j++) {
          Parameter param = (Parameter)parameters.get(j);
          module.addParameter(param);
        }
      }

      else if (name.equals("outputs")) {
View Full Code Here

   * @param scriptParams Map<String,String> of script values for objects (with scriptlet evaluated)
   */
  protected void prepareScriptParams(Map inputs, Map textParams, Map scriptParams) throws Exception {

    List funcParams = function.getParameters();
    Parameter param;

    for (int i=0; i<funcParams.size(); i++) {
      param = (Parameter)funcParams.get(i);

      //get param value:
        String paramName = param.getName();
        Object value = inputs.get(paramName);

        //determine text value and script value
        String textValue = getTextValue(param, value);
        String scriptValue;

        if (value == null) {
          if (!param.hasNullScriptlet())
            throw new MissingParameterException(paramName);

          textValue = "";
          scriptValue = param.getNullScriptlet();
        }
        else {

          if (param.hasScriptlet()) {
            Map scriptletParams = new HashMap(2);
            scriptletParams.put(paramName, textValue);
            //scriptletParams.put(paramName + ".value", textValue);

            scriptValue = scriptParser.setVariables(param.getScriptlet(), scriptletParams);
          }
          else
            scriptValue = textValue;

        }
View Full Code Here

    public TaskDef createTaskDef(Function function) {
        TaskDef def = new TaskDef();
       
        //inputs:
        List funcParams = function.getParameters();
        Parameter funcParam;
        for (int i=0; i<funcParams.size(); i++) {
            funcParam = (Parameter)funcParams.get(i);
           
            ParameterDef taskInput = convertFunctionParameter(funcParam);
            def.addInput(taskInput);
View Full Code Here

TOP

Related Classes of gri.gridp.modules.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.