Package gri.gridp.modules

Examples of gri.gridp.modules.Output


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

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

    //parse regular:
    String paramName = element.getAttributeValue("name");
    if (paramName == null)
      throw new InvalidModuleException("Output parameter missing required 'name' attribute");

    Output output = new Output(paramName);

    String type = element.getAttributeValue("type");
    if (type == null)
      type = Types.FILE;     //or is FILE_LIST better because it's safer?
    output.setType(type);

    List children = element.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("title"))
        output.setTitle(child.getText());
      else if (name.equals("help"))
        output.setHelp(child.getText());
      else if (name.equals("pattern"))
        output.setPattern(child.getText());
    }

    //validate:
    if (output.getPattern() == null)
      throw new InvalidModuleException("Output parameter missing required 'pattern' element");

    return output;
  }
View Full Code Here


    //search for specified outputs (and remove):
    Map outputs = new HashMap();

    List outputDefs = function.getOutputs();
    Output outputDef;
    for (int i=0; i<outputDefs.size(); i++) {
      outputDef = (Output)outputDefs.get(i);
      fileMatcher.setPattern(outputDef.getPattern());

      if (outputDef.getType().equals("file")) {
        File matchingFile = removeMatch(files, fileMatcher);
        outputs.put(outputDef.getName(), matchingFile);
      }
      else {
        List matchingFiles = removeMatches(files, fileMatcher);
        outputs.put(outputDef.getName(), matchingFiles);
      }
    }
   
    return outputs;
  }
View Full Code Here

            def.addInput(taskInput);
        }
       
        //outputs:
        List outputs = function.getOutputs();
        Output output;
        for (int i=0; i<outputs.size(); i++) {
            output = (Output)outputs.get(i);
           
            ParameterDef taskOutput = convertOutput(output);
            def.addOutput(taskOutput);
View Full Code Here

TOP

Related Classes of gri.gridp.modules.Output

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.