public <T> Parameter<T> parameter( String name, Class<T> type, InternationalString title, InternationalString description, boolean required, int minOccurs, int maxOccurs, T defaultValue) { return new org.geotools.data.Parameter<T>( name, type, title, description, required, minOccurs, maxOccurs, defaultValue, null); };
/** * Named parameter (argument or result). * * @param name name of parameter * @param type type of parameter * @return parameter description */ public static <T> Parameter<T> parameter(String name, Class<T> type) { return new org.geotools.data.Parameter<T>(name, type); } /**
/** * @param name name of parameter * @param type type of parameter * @param title human readable title * @param description human readable description * @return parameter description */ public static <T> Parameter<T> parameter( String name, Class<T> type, String title, String description) { return new org.geotools.data.Parameter<T>(name, type, title, description); } }
/** * Named parameter (argument or result). * * @param name name of parameter * @param type type of parameter * @param min multiplicity * @param max multiplicity * @return parameter description */ public static <T> Parameter<T> parameter(String name, Class<T> type, int min, int max) { return new org.geotools.data.Parameter<T>(name, type, min, max); } /**
@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; }
return new org.geotools.data.Parameter(name, type, min, max);
if (!Void.class.equals(method.getReturnType())) { Parameter<?> VALUE = new Parameter( "result", method.getReturnType(),
for (Entry<String, Object> entry : resultMap.entrySet()) { Parameter<?> parameter = new Parameter( entry.getKey(), entry.getValue().getClass(),
private void addResult(Method method, Map<String, Parameter<?>> result, DescribeResult info) { Class resultType = info.type(); if (Object.class.equals(resultType)) { resultType = method.getReturnType(); } // metadata Map<String, Object> metadata = null; if (info != null && info.meta() != null && info.meta().length > 0) { String[] meta = info.meta(); metadata = new HashMap<String, Object>(); fillParameterMetadata(meta, metadata); } int min = info.primary() ? 0 : 1; Parameter resultParam = new Parameter( info.name(), resultType, new SimpleInternationalString(info.name()), new SimpleInternationalString(info.description()), min > 0, min, 1, null, metadata); result.put(resultParam.key, resultParam); }
public <T> Parameter<T> parameter(String name, Class<T> type, InternationalString title, InternationalString description, boolean required, int minOccurs, int maxOccurs, T defaultValue) { return new org.geotools.data.Parameter<T>(name, type, title, description, required, minOccurs, maxOccurs, defaultValue, null); };
public static Parameter<?> parameter(String name, Class type, int min, int max) { return new org.geotools.data.Parameter(name, type, min, max); } }
public Parameter build() { Map<String, Object> metadata = new HashMap<>(2); if (prefix != null) { metadata.put(OpenSearchParameters.PARAM_PREFIX, prefix); } if (name != null) { metadata.put(OpenSearchParameters.PARAM_NAME, name); } if (min != null) { metadata.put(OpenSearchParameters.MIN_INCLUSIVE, min); } if (max != null) { metadata.put(OpenSearchParameters.MAX_INCLUSIVE, max); } return new Parameter<>( key, type, null, null, required, required ? 1 : 0, 1, null, Collections.unmodifiableMap(metadata)); }
@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; }
Parameter<?> VALUE = new Parameter("result", method.getReturnType(), "Process result", "No description is available"); result.put(VALUE.key, VALUE);
page.add(description); for( Entry<String, Object> entry : resultMap.entrySet() ) { Parameter< ? > parameter = new Parameter(entry.getKey(), entry.getValue().getClass(), Text.text("Result"), Text.text("Result of process")); JLabel label = new JLabel(entry.getKey()); page.add(label);
page.add(description); for (Entry<String, Object> entry : resultMap.entrySet()) { Parameter<?> parameter = new Parameter(entry.getKey(), entry.getValue().getClass(), Text.text("Result"), Text.text("Result of process")); JLabel label = new JLabel(entry.getKey());
Parameter parameter( String name, Object type, int min, int max, Object desc, Object defaultValue, Map metadata) { Class clazz = null; if (type != null && type instanceof PyType) { clazz = PythonPlugin.toJavaClass((PyType) type); } if (clazz == null) { clazz = Object.class; } desc = desc != null ? desc : name; return new Parameter( name, clazz, Text.text(name), Text.text(desc.toString()), min > 0, min, max, defaultValue, metadata); } }
private void addResult(Method method, Map<String, Parameter<?>> result, DescribeResult info) { Class resultType = info.type(); if (Object.class.equals(resultType)) { resultType = method.getReturnType(); } int min = info.primary() ? 0 : 1; Parameter resultParam = new Parameter(info.name(), resultType, new SimpleInternationalString(info.name()), new SimpleInternationalString(info.description()), min > 0, min, 1, null, null); result.put(resultParam.key, resultParam); }
/** * Create a new Parameter with all of the values of the given Parameter except for it's Type * * @param param A Parameter * @param type The new Class type * @return A new Parameter */ private Parameter changeParamType(Parameter param, Class type) { return new Parameter( param.getName(), type, param.getTitle(), param.getDescription(), param.isRequired(), param.getMinOccurs(), param.getMaxOccurs(), param.getDefaultValue(), null); } }