Package org.geotools.data

Examples of org.geotools.data.Parameter


            }
            else {
                desc = arg;
            }
           
            inputs.put(arg, new Parameter(arg, clazz, arg, desc.toString()));
        }
        return inputs;
    }
View Full Code Here


    private GeometryFactory geometryFactory = new GeometryFactory();

    @SuppressWarnings("unchecked")
    public Map<String, Parameter<?>> getResultInfo(Map<String, Object> inputs) {
        Map<String, Parameter<?>> outputInfo = new HashMap<String, Parameter<?>>();
        outputInfo.put("result", new Parameter("result", FeatureCollection.class, Text
                .text("Result"), Text.text("The nearest feature")));
        return outputInfo;
    }
View Full Code Here

                // see if a type has been declared, otherwise use the annotation
                Class resultType = info.type();
                if (Object.class.equals(resultType)) {
                    resultType = method.getReturnType();
                }
                Parameter<?> resultParam = new Parameter(info.name(), resultType, info.name(), info
                        .description());
                result.put(resultParam.key, resultParam);
            }
        }
        // if annotation is not found, return a generic description using
        // the method return type
        if (result.isEmpty()) {
            if (!Void.class.equals(method.getReturnType())) {
                Parameter<?> VALUE = new Parameter("result", method.getReturnType(),
                        "Process result", "No description is available");
                result.put(VALUE.key, VALUE);
            }
        }
        return result;
View Full Code Here

            throw new IllegalArgumentException("Optional values cannot be primitives, " +
                "use the associated object wrapper instead: " + info.name() + " in process " + process.getName());
        }
        // finally build the parameter
        if (info != null) {
            return new Parameter(info.name(), type, new SimpleInternationalString(info.name()),
                    new SimpleInternationalString(info.description()), min > 0, min, max, null,
                    null);
        } else {
            return new Parameter("arg" + i, type, new SimpleInternationalString("Argument " + i),
                    new SimpleInternationalString("Input " + type.getName() + " value"), min > 0,
                    min, max, null, null);
        }
    }
View Full Code Here

                    args[i] = monitor;
                } else {
                    // find the corresponding argument in the input
                    // map and set it
                    Class<? extends Object> target = targetObject == null ? null : targetObject.getClass();
          Parameter p = paramInfo(target, i, paramTypes[i], annotations[i]);
                    Object value = input.get(p.key);

                    // this takes care of array/collection conversions among
                    // others
                    args[i] = Converters.convert(value, paramTypes[i]);
View Full Code Here

        Map<String, Parameter<?>> outs = pf.getResultInfo(processName, null);
        Map<String, ProcessParameterIO> ppios = new HashMap();

        for (String key : outputMap.keySet()) {
            Parameter p = pf.getResultInfo(processName, null).get(key);
            if (p == null) {
                throw new WPSException("No such output: " + key);
            }

            // find the ppio
View Full Code Here

        for (Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext();) {
            InputType input = (InputType) i.next();
            String inputId = input.getIdentifier().getValue();

            // locate the parameter for this request
            Parameter p = parameters.get(inputId);
            if (p == null) {
                throw new WPSException("No such parameter: " + inputId);
            }

            // find the ppio
View Full Code Here

        inputView = new ListView<InputParameterValues>("inputs", new PropertyModel(execute, "inputs")) {

            @Override
            protected void populateItem(ListItem item) {
                InputParameterValues pv = (InputParameterValues) item.getModelObject();
                Parameter p = pv.getParameter();
                item.add(new Label("param", buildParamSpec(p)));
                item.add(new Label("paramDescription", p.description.toString(Locale.ENGLISH)));
                // TODO: roll out an extension point for these editors
                final PropertyModel property = new PropertyModel(pv,
                        "values[0].value");
                if (pv.isBoundingBox()) {
                    EnvelopePanel envelope = new EnvelopePanel("paramValue", property);
                    envelope.setCRSFieldVisible(true);
                    item.add(envelope);
                } else if (pv.isCoordinateReferenceSystem()) {
                    CRSPanel crs = new CRSPanel("paramValue", property);
                    item.add(crs);
                } else if (pv.isEnum()) {
                    EnumPanel panel = new EnumPanel("paramValue", ((Class<Enum>) pv.getParameter().type),
                            property);
                    item.add(panel);
                } else if(pv.isComplex()) {
                    ComplexInputPanel input = new ComplexInputPanel("paramValue", pv, 0);
                    item.add(input);
                } else {
                    Fragment f = new Fragment("paramValue", "literal", WPSRequestBuilderPanel.this);
                    FormComponent literal = new TextField("literalValue", property);
                    literal.setRequired(p.minOccurs > 0);
                    literal.setLabel(new Model<String>(p.key));
                    f.add(literal);
                    item.add(f);
                }
            }
        };
        inputView.setReuseItems(true);
        inputContainer.add(inputView);

        outputContainer = new WebMarkupContainer("outputContainer");
        outputContainer.setVisible(false);
        add(outputContainer);
        outputView = new ListView("outputs", new PropertyModel(execute, "outputs")) {

            @Override
            protected void populateItem(ListItem item) {
                OutputParameter pv = (OutputParameter) item.getModelObject();
                Parameter p = pv.getParameter();
                item.add(new CheckBox("include", new PropertyModel<Boolean>(pv, "include")));
                item.add(new Label("param", buildParamSpec(p)));
                item.add(new Label("paramDescription", p.description.toString(Locale.ENGLISH)));
                if (pv.isComplex()) {
                    DropDownChoice mime = new DropDownChoice("mime", new PropertyModel(pv,
View Full Code Here

      throws ScriptException {
    Map<String, Parameter<?>> inputs = super.getInputs(engine);
    // Convert all input Parameters from GeoScript types to GeoTools Types
    for(Map.Entry<String,Parameter<?>> entry : inputs.entrySet()) {
      String key = entry.getKey();
      Parameter param = entry.getValue();
      Class clazz = geoscript.process.Process.convertGeoScriptToGeoToolsClass(param.getType());
      param = changeParamType(param, clazz);
      inputs.put(key, param);
    }
    return inputs;
  }
View Full Code Here

      throws ScriptException {
    Map<String, Parameter<?>> outputs = super.getOutputs(engine);
    // Convert all output Parameters from GeoScript types to GeoTools Types
    for(Map.Entry<String,Parameter<?>> entry : outputs.entrySet()) {
      String key = entry.getKey();
      Parameter param = entry.getValue();
      Class clazz = geoscript.process.Process.convertGeoScriptToGeoToolsClass(param.getType());
      param = changeParamType(param, clazz);
      outputs.put(key, param);
    }
    return outputs;
  }
View Full Code Here

TOP

Related Classes of org.geotools.data.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.