Converts a String parameter to a JAXP Source object.
@param param a String parameter
@return Source the generated Source object
975385
protected Source convertString2Source(String param) {
        Source src;
        try {
            src = uriResolver.resolve(param, null);
        } catch (TransformerException e) {
            src = null;
        }
        if (src == null) {
            src = new StreamSource(new File(param));
        }
        return src;
    }
1220617
public EquivalentParameter convert(Parameter p) {
        if (p == null) return null;
        return paramCvtr.convert(p);
    }
810940
public static Class<?>[] convertParams(Object[] source) {
        Class<?>[] converted = null;
        if (source != null) {
            converted = new Class<?>[source.length];
            for (int i = 0; i < source.length; i++) {
                if (source[i] != null) {
                    // if the class is not an instance of IConnection use its class
                    //if (!IConnection.class.isInstance(source[i])) {
                    converted[i] = source[i].getClass();
                    //} else {
                    // if it does implement IConnection use the interface
                    //converted[i] = IConnection.class;
                    //}
                } else {
                    converted[i] = null;
                }
            }
        } else {
            converted = new Class<?>[0];
        }
        if (log.isTraceEnabled()) {
            log.trace("Converted parameters: {}", Arrays.toString(converted));
        }
        return converted;
    }
658862
public String getString(final String param) {
    checkNotNull(param);
    checkArgument(!param.isEmpty());

    final String ret = params.get(param);
    observeWithListeners(param);

    if (ret != null) {
      return ret;
    } else {
      throw new MissingRequiredParameter(fullString(param));
    }
  }
345311
public static Object[] convertParams(Object[] source, Class<?>[] target) throws ConversionException {
        Object[] converted = new Object[target.length];
        for (int i = 0; i < target.length; i++) {
            converted[i] = convert(source[i], target[i]);
        }
        return converted;
    }
1285367
public static Element createParam (String name, String value)
    {
        Element pelem = DOM.createElement("param");
        DOM.setElementProperty(pelem, "name", name);
        DOM.setElementProperty(pelem, "value", value);
        return pelem;
    }
358834
public Map<String, String> getParamMap(String params) {
    Map<String, String> result = new HashMap<String, String>();
    String[] paramlist = params.split("&");
    for (int i = 0; i < paramlist.length; i++) {
      String[] parts = paramlist[i].split("=");
      if (parts.length == 2)
        result.put(parts[0], parts[1]);
    }
    return result;
  }
1246777
public String param(String name) {
		String pathValue = pathParams.get(name);
		return (pathValue == null) ? queryParam(name) : pathValue;
	}
140052
public static Map<String, String> getUrlParams(String param) {
        Map<String, String> map = new HashMap<String, String>();
        if (StringUtils.isEmpty(param)) {
            return map;
        }
        String[] params = param.split("&");
        for (int i = 0; i < params.length; i++) {
            String[] p = params[i].split("=");
            if (p.length == 2) {
                map.put(p[0], p[1]);
            }
        }
        return map;
    }
401679
public static String encodeParameter(Object source) {

		Assert.notNull(source, "Request parameter value must not be null!");

		try {
			return UriUtils.encodeQueryParam(source.toString(), ENCODING);
		} catch (Throwable e) {
			throw new IllegalStateException(e);
		}
	}
1217963
public static Map<String, String[]> getParameterMapFromJSON(JSONObject params) {

        Map<String, String[]> result = new HashMap<String, String[]>();
        Iterator<String> itKeys = params.keys();
        while (itKeys.hasNext()) {
            String key = itKeys.next();
            JSONArray paramValue = params.optJSONArray(key);
            result.put(key, new String[paramValue.length()]);
            for (int i = 0, l = paramValue.length(); i < l; i++) {
                result.get(key)[i] = paramValue.optString(i);
            }
        }
        return result;
    }
660187
protected String encode(String param) throws Exception {
    String result = URLEncoder.encode(param, "UTF-8");
    return result;
  }
749514
public String getInitParameter(String param)
    {
        if (_initParams==null)
            return null;
        return (String)_initParams.get(param);
    }
531404
public static String generateQuery(final Map<String,Object> params){
		final StringBuilder sb = new StringBuilder();
		boolean newEntry = false;
		
		sb.append("{");
		for(final Entry<String,Object> param: params.entrySet()){
			if(newEntry){
				sb.append(", ");
			}

			sb.append(param.getKey());
			sb.append(": ");
			sb.append(getParam(param.getValue()));
			newEntry = true;
		}
		sb.append("}");
		
		return sb.toString();
	}
407956
private Source getPayloadSource(Object payload) {
        Source source = null;
        
        if (payload instanceof String) {
            source = new StringSource((String) payload);
        } else if (payload instanceof File) {
            source = new StreamSource((File) payload);
        } else if (payload instanceof Document) {
            source = new DOMSource((Document) payload);
        } else if (payload instanceof Source) {
            source = (Source) payload;
        }
        
        if (source == null) {
            throw new CitrusRuntimeException("Failed to create payload source for unmarshalling message");
        }
        
        return source;
    }
1317957
static JSONObject addSource(JSONObject params) {
        if (params == null) {
            params = new JSONObject();
        }
        try {
            params.put("source", "android");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return params;
    }
408588
private StringBuffer buildEncodedParameters(LinkedHashMap<String, String> params) {
		StringBuffer parametersUrlGet = new StringBuffer("");

		if (null != params) {
			for (String key : params.keySet()) {

				String value = params.get(key);
				String encodedParameter = encodeHttpParameter(value);

				// It builds something like
				// "&param1=file%20name%26blues for entry "param1","file name&blues"
				parametersUrlGet.append("&").append(key).append("=").append(encodedParameter);
			}
		}
		return parametersUrlGet;
	}