(Type type)
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public BiFunction<JsonInput, PropertySetting, URI> apply(Type type) { |
| 34 | return (jsonInput, propertySetting) -> { |
| 35 | String toCoerce; |
| 36 | |
| 37 | switch (jsonInput.peek()) { |
| 38 | case NAME: |
| 39 | toCoerce = jsonInput.nextName(); |
| 40 | break; |
| 41 | |
| 42 | case STRING: |
| 43 | toCoerce = jsonInput.nextString(); |
| 44 | break; |
| 45 | |
| 46 | default: |
| 47 | throw new JsonException("Unable to coerce type to URI: " + jsonInput.peek()); |
| 48 | } |
| 49 | |
| 50 | try { |
| 51 | return new URI(toCoerce); |
| 52 | } catch (URISyntaxException e) { |
| 53 | throw new JsonException(e); |
| 54 | } |
| 55 | }; |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected