Package gri.data

Examples of gri.data.DataType


      throw new InvalidXMLException("Parameter missing required 'name' attribute");

    Element typeElem = elem.getChild("type");
    if (typeElem == null)
      throw new InvalidXMLException("Parameter missing required 'type' element");
    DataType dataType = parseDataType(typeElem);

    String displayName = null;
    Element labelElem = elem.getChild("label");
    if (labelElem != null)
      displayName = labelElem.getText();

    Element descriptionElem = elem.getChild("description");
    String description = descriptionElem == null ?
        null : descriptionElem.getText();

    List options = null;
    Element optionsElem = elem.getChild("options");
    if (optionsElem != null)
      options = parseOptions(optionsElem, dataType.getRepresentationClass());

    Object defaultValue = null;
    Element defaultElem = elem.getChild("default");
    if (defaultElem != null)
      defaultValue = parseValue(defaultElem.getText(), dataType.getRepresentationClass());

    //create parameter:

    ParameterDef param = new ParameterDef(name, dataType, description);
View Full Code Here


    String content = elem.getAttributeValue("content");
    if (content == null)
      return typeMapping.getDefaultTypeForClass(klass);
    else
      return new DataType(getClass(className), content);
  }
View Full Code Here

        public Widget createWidget(DataType type) {
            //list:
            if (type instanceof ListDataType) {
                ListDataType listType = (ListDataType)type;
                if (type.getRepresentationClass().isAssignableFrom(List.class)) {
                    DataType memberType = listType.getMemberType();
                    WidgetFactory memberWidgetFactory = new TypedWidgetFactoryWrapper(this, memberType);
                   
                    Widget widget = new WidgetList(memberWidgetFactory);
                    return widget;
                }
View Full Code Here

    public DataType readDataType(Element elem) {
        String contentType = elem.getAttributeValue("content");
       
        if (contentType.equals(ListDataType.LIST_CONTENT)) {
            Element memberTypeElem = elem.getChild("memberType");
            DataType memberType = readDataType(memberTypeElem);
            return new ListDataType(List.class, memberType);
        }
        else    
            return typeMapping.getDefaultTypeForContent(contentType);
       
View Full Code Here

        }
      
    }
    public ParameterDef readParamDef(Element elem) throws IOException {
        String paramName = elem.getAttributeValue("name");
        DataType dataType;
       
        Element typeElem = elem.getChild("type");
        if (typeElem == null)
            throw new IOException("Error: Parameter missing data type");
      
View Full Code Here

    }
   
    // -------------------------------------------- Implementation
   
    public JDOMSerializer getSerializer(ParameterDef paramDef, Map config) {
  DataType type = paramDef.getDataType();
  return typedFactory.getSerializer(type, config);
    }
View Full Code Here

            ParameterDef exitCode = new ParameterDef(EXIT_CODE, Types.INTEGER, "Exit code returned by program");
            ParameterDef jobout = new ParameterDef(STDOUT_FILE, Types.FILE, "File containing standard output from the script");
            ParameterDef joberr = new ParameterDef(STDERR_FILE, Types.FILE, "File containing standard error from the script");
            ParameterDef script = new ParameterDef(SCRIPT, Types.FILE, "File containing the script that was executed");
           
            DataType FILE_LIST = Types.createListType(List.class, Types.FILE);
            ParameterDef outputFiles = new ParameterDef("outputFiles", FILE_LIST, "Output files");
           
            exitCode.setDisplayName("Exit Code");
            jobout.setDisplayName("Standard Output File");
            joberr.setDisplayName("Standard Error File");
View Full Code Here

        return serializer;
      }
     
      //List<TaskStub>
      else if (content.equals(ListDataType.LIST_CONTENT)) {
    DataType memberType = ((ListDataType)type).getMemberType();
    if (memberType.equals(TaskStub.DATA_TYPE)) {
        serializer = getTaskStubSerializer(config);
        if (serializer != null)
      return new TaskStubListSerializer(serializer);
    }
      }
View Full Code Here

            //ParameterDef exitCode = new ParameterDef("exitcode", Types.INTEGER, "Exit code returned by program");
            ParameterDef jobout = new ParameterDef(STDOUT_FILE, Types.FILE, "File containing standard output from the script");
            ParameterDef joberr = new ParameterDef(STDERR_FILE, Types.FILE, "File containing standard error from the script");
            ParameterDef script = new ParameterDef(SCRIPT, Types.FILE, "File containing the script that was executed");
           
            DataType FILE_LIST = Types.createListType(List.class, Types.FILE);
            ParameterDef outputFiles = new ParameterDef("outputFiles", FILE_LIST, "Output files");
           
            //exitCode.setDisplayName("Exit Code");
            jobout.setDisplayName("Standard Output File");
            joberr.setDisplayName("Standard Error File");
View Full Code Here

TOP

Related Classes of gri.data.DataType

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.