@Override public JsonDeserializer<?> getDeserializerForJavaNioFilePath(Class<?> rawType) { if (rawType == Path.class) { return new NioPathDeserializer(); } return null; }
uri = new URI(value); } catch (URISyntaxException e) { return (Path) ctxt.handleInstantiationProblem(handledType(), value, e); return (Path) ctxt.handleInstantiationProblem(handledType(), value, cause); } catch (Throwable e) { e.addSuppressed(cause); return (Path) ctxt.handleInstantiationProblem(handledType(), value, e); return (Path) ctxt.handleInstantiationProblem(handledType(), value, e);
@Override public JsonDeserializer<?> getDeserializerForJavaNioFilePath(Class<?> rawType) { if (rawType == Path.class) { return new NioPathDeserializer(); } return null; }
@Override public Path deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { if (!p.hasToken(JsonToken.VALUE_STRING)) { return (Path) ctxt.handleUnexpectedToken(Path.class, p); } final String value = p.getText(); // If someone gives us an input with no : at all, treat as local path, instead of failing // with invalid URI. if (value.indexOf(':') < 0) { return Paths.get(value); } try { URI uri = new URI(value); return Paths.get(uri); } catch (URISyntaxException e) { return (Path) ctxt.handleInstantiationProblem(handledType(), value, e); } } }
@Override public JsonDeserializer<?> getDeserializerForJavaNioFilePath(Class<?> rawType) { if (rawType == Path.class) { return new NioPathDeserializer(); } return null; }
uri = new URI(value); } catch (URISyntaxException e) { return (Path) ctxt.handleInstantiationProblem(handledType(), value, e); return (Path) ctxt.handleInstantiationProblem(handledType(), value, cause); } catch (Throwable e) { e.addSuppressed(cause); return (Path) ctxt.handleInstantiationProblem(handledType(), value, e); return (Path) ctxt.handleInstantiationProblem(handledType(), value, e);