@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { errors.add(new ParseError(this, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { errors.add(new ParseError(this, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { errors.add(new ParseError(this, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { errors.add(new ParseError(this, e, tokenNames)); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { gParent.errors.add(new ParseError(gParent, e, tokenNames)); }
@Override protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) { try { String jsonString = new String(response.data, HttpHeaderParser.parseCharset(response.headers, PROTOCOL_CHARSET)); JSONObject result = null; if (jsonString != null && jsonString.length() > 0) result = new JSONObject(jsonString); return Response.success(result, HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je)); } }
public class GsonRequest<T> extends Request<T> { ... private int mStatusCode; public int getStatusCode() { return mStatusCode; } ... @Override protected Response<T> parseNetworkResponse(NetworkResponse response) { mStatusCode = response.statusCode; try { Log.d(TAG, "[raw json]: " + (new String(response.data))); Gson gson = new Gson(); String json = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); return Response.success(gson.fromJson(json, mClazz), HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JsonSyntaxException e) { return Response.error(new ParseError(e)); } } ... }
HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je));
return Response.error(new ParseError(e)); } catch (JsonSyntaxException e) { return Response.error(new ParseError(e));
HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je));
return Response.success(new JSONObject(jsonString), cacheEntry); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException e) { return Response.error(new ParseError(e));
return Response.success(parsedObject, HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JsonSyntaxException e) { return Response.error(new ParseError(e));
return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je));
HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JsonSyntaxException e) { return Response.error(new ParseError(e));
HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je));