@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // For most types, use super impl; but GregorianCalendar also allows // integer value (timestamp), which needs separate handling if (_kind == TYPE_G_CALENDAR) { if (p.hasToken(JsonToken.VALUE_NUMBER_INT)) { return _gregorianFromDate(ctxt, _parseDate(p, ctxt)); } } return super.deserialize(p, ctxt); }
@Override public HostAndPort deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { // Need to override this method, which otherwise would work just fine, // since we have legacy JSON Object format to support too: if (jp.getCurrentToken() == JsonToken.START_OBJECT) { // old style JsonNode root = jp.readValueAsTree(); String host = root.path("hostText").asText(); JsonNode n = root.get("port"); if (n == null) { return HostAndPort.fromString(host); } return HostAndPort.fromParts(host, n.asInt()); } return super.deserialize(jp, ctxt); }
@Override public HostAndPort deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { // Need to override this method, which otherwise would work just fine, // since we have legacy JSON Object format to support too: if (jp.getCurrentToken() == JsonToken.START_OBJECT) { // old style JsonNode root = jp.readValueAsTree(); String host = root.path("hostText").asText(); JsonNode n = root.get("port"); if (n == null) { return HostAndPort.fromString(host); } return HostAndPort.fromParts(host, n.asInt()); } return super.deserialize(jp, ctxt); }
@Override public Object deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // For most types, use super impl; but not for GregorianCalendar if (_kind == TYPE_G_CALENDAR) { Date d = _parseDate(jp, ctxt); if (d == null) { return null; } GregorianCalendar calendar = new GregorianCalendar(); calendar.setTime(d); TimeZone tz = ctxt.getTimeZone(); if (tz != null) { calendar.setTimeZone(tz); } return _dataTypeFactory.newXMLGregorianCalendar(calendar); } return super.deserialize(jp, ctxt); }
@Override public Object deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { // For most types, use super impl; but not for GregorianCalendar if (_kind == TYPE_G_CALENDAR) { Date d = _parseDate(jp, ctxt); if (d == null) { return null; } GregorianCalendar calendar = new GregorianCalendar(); calendar.setTime(d); TimeZone tz = ctxt.getTimeZone(); if (tz != null) { calendar.setTimeZone(tz); } return _dataTypeFactory.newXMLGregorianCalendar(calendar); } return super.deserialize(jp, ctxt); }
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // For most types, use super impl; but GregorianCalendar also allows // integer value (timestamp), which needs separate handling if (_kind == TYPE_G_CALENDAR) { if (p.hasToken(JsonToken.VALUE_NUMBER_INT)) { return _gregorianFromDate(ctxt, _parseDate(p, ctxt)); } } return super.deserialize(p, ctxt); }
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // For most types, use super impl; but GregorianCalendar also allows // integer value (timestamp), which needs separate handling if (_kind == TYPE_G_CALENDAR) { if (p.hasToken(JsonToken.VALUE_NUMBER_INT)) { return _gregorianFromDate(ctxt, _parseDate(p, ctxt)); } } return super.deserialize(p, ctxt); }
final T value = deserialize(jp, ctxt); if (jp.nextToken() != JsonToken.END_ARRAY) { throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY,
final T value = deserialize(jp, ctxt); if (jp.nextToken() != JsonToken.END_ARRAY) { throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY,