Package gri.data.serializers.jdom

Examples of gri.data.serializers.jdom.ListSerializer


      elem.addContent(createElement("help", param.getHelp()));

    if (param.hasOptions()) {
      Element optionsElem = new Element("options");

      ListSerializer serializer = new ListSerializer(
          new OptionSerializer(), "option");
      serializer.writeList(param.getOptionList(), optionsElem);

      elem.addContent(optionsElem);
    }

    if (param.hasDefault())
View Full Code Here


      if (name.equals("title"))
        param.setTitle(child.getText());
      else if (name.equals("help"))
        param.setHelp(child.getText());
      else if (name.equals("options"))  {
        ListSerializer serializer = new ListSerializer(
            new OptionSerializer(), "option");
        param.setOptionList(serializer.readList(child));
      }
      else if (name.equals("default"))
        param.setDefault(child.getText());
      else if (name.equals("scriptlet"))
        param.setScriptlet(child.getText());
View Full Code Here

    //outputs
    List outputs = function.getOutputs();
    if (!outputs.isEmpty()) {
      Element outputsElem = new Element("outputs");
      new ListSerializer(outputSerializer, "output")
      .writeList(outputs, outputsElem);
      elem.addContent(outputsElem);
    }

    //script
View Full Code Here

      else if (name.equals("parameters"))
        function.setParameters(paramListSerializer.readList(child));

      else if (name.equals("outputs")) {
        List outputs = new ListSerializer(outputSerializer, "output").readList(child);
        function.setOutputs(outputs);
      }

      else if (name.equals("script")) {
        Script script = scriptSerializer.readScript(child);
View Full Code Here

    Map outputs = module.getOutputMap();
    if (!outputs.isEmpty()) {
      List outputList = toList(outputs.values());

      Element outputsElem = new Element("outputs");
      new ListSerializer(outputSerializer, "output")
      .writeList(outputList, outputsElem);

      elem.addContent(outputsElem);
    }

    //functions
    List functions = module.getFunctionList();
    if (!functions.isEmpty()) {
      Element functionsElem = new Element("functions");

      ListSerializer serializer = new ListSerializer(
          new FunctionSerializer(
              module.getParameterMap(), module.getOutputMap()),
      "function");
      serializer.writeList(functions, functionsElem);

      elem.addContent(functionsElem);
    }
  }
View Full Code Here

          module.addParameter(param);
        }
      }

      else if (name.equals("outputs")) {
        List outputs = new ListSerializer(outputSerializer, "output").readList(child);
        for (int j=0; j<outputs.size(); j++)
          module.addOutput((Output)outputs.get(j));
      }

      else if (name.equals("functions")) {
        ListSerializer serializer = new ListSerializer(
            new FunctionSerializer(
                module.getParameterMap(), module.getOutputMap()),
        "function");
        List functions = serializer.readList(child);
        for (int functionIndex=0; functionIndex<functions.size(); functionIndex++) {
          Function function = (Function)functions.get(functionIndex);   
          module.addFunction(function);
        }
      }
View Full Code Here

        if (nameElem != null)
            acl.setName(nameElem.getText());
       
        //get entries:
        Element entriesElem = elem.getChild("entries");
        List entries = (List) new ListSerializer(serializer, "entry").read(entriesElem);
       
        for (int i=0; i<entries.size(); i++)
            acl.addEntry((JaasAclEntry)entries.get(i));
       
        return acl;
View Full Code Here

   
    public AclEntrySerializer() {
        principalSerializer = new NamedPrincipalAndGroupSerializer();
       
        JDOMSerializer permSerializer = new PermissionSerializer();
        permissionListSerializer = new ListSerializer(permSerializer, "perm");
    }
View Full Code Here

    public void writeSet(JobManagerSet managers, Element elem) {
      throw new RuntimeException("Not implemented");
    }
    public JobManagerSet readSet(Element elem) throws IOException {
      ListSerializer listSerializer = new ListSerializer(jobEntrySerializer, "jobManagerEntry");
      List entries = listSerializer.readList(elem);
      return new JobManagerSet(entries);
    }
View Full Code Here

      throw new IOException(e.getMessage());
    }
  }

  public BasicTaskManager readTaskManager(Element elem) throws Exception {
    List fileNames = new ListSerializer(
        Serializers.STRING_SERIALIZER, "file").readList(elem);
   
    FunctionXMLParser parser = new FunctionXMLParser();
   
    BasicTaskCollection tasks = new BasicTaskCollection();
View Full Code Here

TOP

Related Classes of gri.data.serializers.jdom.ListSerializer

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.