/** * Specialized called when we need to expose type id of `defaultImpl` when * serializing: we may need to expose it for assignment to a property, or * it may be requested as visible for some other reason. */ public String getDefaultTypeId() { Class<?> defaultType = _typeDeserializer.getDefaultImpl(); if (defaultType == null) { return null; } return _typeDeserializer.getTypeIdResolver().idFromValueAndType(null, defaultType); }
@SuppressWarnings("unchecked") @Override public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { return (T) typeDeserializer.deserializeTypedFromAny(jsonParser, deserializationContext); } }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromArray(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromObject(p, ctxt); }
public WritableTypeId typeId(Object value, JsonToken valueShape, Object id) { WritableTypeId typeId = typeId(value, valueShape); typeId.id = id; return typeId; }
@Override // since 2.9 public WritableTypeId writeTypePrefix(JsonGenerator g, WritableTypeId typeId) throws IOException { // 28-Jun-2017, tatu: Important! Need to "override" value typeId.forValue = _forObject; return _typeSerializer.writeTypePrefix(g, typeId); }
public ExtTypedProperty(SettableBeanProperty property, TypeDeserializer typeDeser) { _property = property; _typeDeserializer = typeDeser; _typePropertyName = typeDeser.getPropertyName(); }
@Override // since 2.9 public WritableTypeId writeTypeSuffix(JsonGenerator g, WritableTypeId typeId) throws IOException { // NOTE: already overwrote value object so: return _typeSerializer.writeTypeSuffix(g, typeId); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromScalar(p, ctxt); }
@Override public TypeIdResolver getTypeIdResolver() { return _typeSerializer.getTypeIdResolver(); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Output can be as JSON Object, Array or scalar: no way to know a priori: return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Should there be separate handling for base64 stuff? // for now this should be enough: return typeDeserializer.deserializeTypedFromArray(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromObject(p, ctxt); }
public WritableTypeId typeId(Object value, Class<?> typeForId, JsonToken valueShape) { WritableTypeId typeId = typeId(value, valueShape); typeId.forValueType = typeForId; return typeId; }
/** * Base implementation that does not assume specific type * inclusion mechanism. Sub-classes are expected to override * this method if they are to handle type information. */ @Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { return typeDeserializer.deserializeTypedFromAny(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException { return typeDeserializer.deserializeTypedFromArray(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromObject(p, ctxt); } }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromArray(p, ctxt); }
@Override public Object[] deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // Should there be separate handling for base64 stuff? // for now this should be enough: return (Object[]) typeDeserializer.deserializeTypedFromArray(p, ctxt); }
@Override public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException { // In future could check current token... for now this should be enough: return typeDeserializer.deserializeTypedFromArray(p, ctxt); } }