return o;
}
public Object loadParameters(Object o) throws Exception {
ObjectObject item = (ObjectObject)o;
ArrayObject a = new ArrayObject(jsContext);
FBSValue a1 = (FBSValue)item.get("uriParameters");
if(a1.isArray()) {
for(int i=0; i<a1.getArrayLength(); i++) {
a.addArrayValue(a1.getArrayValue(i));
}
}
FBSValue a2 = (FBSValue)item.get("queryParameters");
if(a2.isArray()) {
for(int i=0; i<a2.getArrayLength(); i++) {
a.addArrayValue(a2.getArrayValue(i));
}
}
FBSValue a3 = (FBSValue)item.get("headers");
if(a3.isArray()) {
for(int i=0; i<a3.getArrayLength(); i++) {
a.addArrayValue(a3.getArrayValue(i));
}
}
// Add a pseudo query string parameter
boolean qstring = item.get("queryString").booleanValue();
if(qstring) {
ObjectObject qs = addParam(a, FBSString.get("query-string"), FBSString.emptyString, FBSUtility.wrap("string"), FBSUtility.wrap("Extra query string parameters, as they would appear in the URL (a=1&b=2...)"));
qs.put("optional", FBSBoolean.TRUE);
}
// Now, add the pseudo entries for the POST/PUT content
FBSValue v = item.get("http_method");
if(v.isString()) {
String m = v.stringValue();
if(m.equalsIgnoreCase("post")||m.equalsIgnoreCase("put")) {
ObjectObject ct = addParam(a, FBSString.get("post_content_type"), item.get("post_content_type"), FBSUtility.wrap("string"), FBSUtility.wrap("Content-Type header of the payload"));
ct.put("optional", FBSBoolean.TRUE);
ObjectObject bd = addParam(a, FBSString.get("post_content"), item.get("post_content"), FBSUtility.wrap("textarea"), FBSUtility.wrap("Text content sent to the service"));
bd.put("optional", FBSBoolean.TRUE);
}
}
return a;
}