| 23 | } |
| 24 | |
| 25 | public Object extract(final Transaction tx) { |
| 26 | if (mPath.isEmpty()) { |
| 27 | return tx; |
| 28 | } |
| 29 | |
| 30 | // The first component in the path is a top-level transaction |
| 31 | // field. All the subsequent fields index into unstructured json. |
| 32 | String field = mPath.get(0); |
| 33 | |
| 34 | Map<String, Object> deserializedJson = null; |
| 35 | switch (field.toLowerCase()) { |
| 36 | case "reference_data": |
| 37 | deserializedJson = tx.referenceData; |
| 38 | break; |
| 39 | } |
| 40 | return extract(deserializedJson, mPath.subList(1, mPath.size())); |
| 41 | } |
| 42 | |
| 43 | public Object extract(final Transaction.Input input) { |
| 44 | if (mPath.isEmpty()) { |