* @return the pdbResponse object for the given request
* @throws Exception
*/
- @SuppressWarnings("unused")
+ @SuppressWarnings({ "unused", "unchecked" })
@Override
public FTSRestResponse executeRequest(FTSRestRequest pdbRestRequest)
throws Exception
+ (pdbRestRequest.isAllowUnpublishedEntries() ? ""
: " AND status:REL");
+ // Build request parameters for the REST Request
+
+ // BH 2018 the trick here is to coerce the classes in Javascript to be
+ // different from the ones in Java yet still allow this to be correct for Java
+ Class<ClientResponse> clientResponseClass;
if (/** @j2sNative true || */
false)
{
+ // JavaScript only -- coerce types to Java types for Java
client = (Client) (Object) new jalview.javascript.web.Client();
+ clientResponseClass = (Class<ClientResponse>) (Object) jalview.javascript.web.ClientResponse.class;
}
else
{
- // Build request parameters for the REST Request
- ClientConfig clientConfig = new DefaultClientConfig();
- client = Client.create(clientConfig);
+ // Java only
+ client = Client.create(new DefaultClientConfig());
+ clientResponseClass = ClientResponse.class;
}
if (pdbRestRequest.isFacet())
// Execute the REST request
ClientResponse clientResponse = webResource
- .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
+ .accept(MediaType.APPLICATION_JSON).get(clientResponseClass );
// Get the JSON string from the response object
String responseString = clientResponse.getEntity(String.class);
}
return allDefaultDisplayedStructureDataColumns;
}
+
+ public static void main(String[] args) {
+
+
+ // check for transpiler fix associated with JSONParser yylex.java use of charAt()
+ // instead of codePointAt()
+
+ String s = "e";
+ char c = 'c';
+ char f = 'f';
+ s += c | f;
+ int x = c&f;
+ int y = 2 & c;
+ int z = c ^ 5;
+ String result = s +x + y + z;
+ assert (result == "e103982102");
+ JSONParser jsonParser = new JSONParser();
+ try
+ {
+ JSONObject jsonObj = (JSONObject) jsonParser.parse("{\"a\":3}");
+ System.out.println(jsonObj);
+ } catch (ParseException e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+
+
}