@Override public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop) { return (_property == prop) ? this : new AsExistingPropertyTypeSerializer(_idResolver, prop, _typePropertyName); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator gen, Class<?> type) throws IOException { final String typeId = idFromValueAndType(value, type); if ((typeId != null) && gen.canWriteTypeId()) { gen.writeTypeId(typeId); } gen.writeStartObject(); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException { final String typeId = idFromValue(value); if ((typeId != null) && jgen.canWriteTypeId()) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen, Class<?> type) throws IOException { final String typeId = idFromValueAndType(value, type); if ((typeId != null) && jgen.canWriteTypeId()) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator gen) throws IOException { final String typeId = idFromValue(value); if ((typeId != null) && gen.canWriteTypeId()) { gen.writeTypeId(typeId); } gen.writeStartObject(); }
@Override public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } // 03-Oct-2016, tatu: As per [databind#1395] better prevent use for primitives, // regardless of setting if (baseType.isPrimitive()) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, true, false); switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeSerializer(idRes, null); case PROPERTY: return new AsPropertyTypeSerializer(idRes, null, _typeProperty); case WRAPPER_OBJECT: return new AsWrapperTypeSerializer(idRes, null); case EXTERNAL_PROPERTY: return new AsExternalTypeSerializer(idRes, null, _typeProperty); case EXISTING_PROPERTY: // as per [#528] return new AsExistingPropertyTypeSerializer(idRes, null, _typeProperty); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen, Class<?> type) throws IOException { final String typeId = idFromValueAndType(value, type); if ((typeId != null) && jgen.canWriteTypeId()) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); }
@Override public void writeTypePrefixForObject(Object value, JsonGenerator jgen) throws IOException { final String typeId = idFromValue(value); if ((typeId != null) && jgen.canWriteTypeId()) { jgen.writeTypeId(typeId); } jgen.writeStartObject(); }
@Override public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop) { return (_property == prop) ? this : new AsExistingPropertyTypeSerializer(_idResolver, prop, _typePropertyName); }
@Override public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop) { return (_property == prop) ? this : new AsExistingPropertyTypeSerializer(this._idResolver, prop, this._typePropertyName); }
@Override public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop) { return (_property == prop) ? this : new AsExistingPropertyTypeSerializer(_idResolver, prop, _typePropertyName); }
@Override public AsExistingPropertyTypeSerializer forProperty(BeanProperty prop) { return (_property == prop) ? this : new AsExistingPropertyTypeSerializer(this._idResolver, prop, this._typePropertyName); }
@Override public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, true, false); switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeSerializer(idRes, null); case PROPERTY: return new AsPropertyTypeSerializer(idRes, null, _typeProperty); case WRAPPER_OBJECT: return new AsWrapperTypeSerializer(idRes, null); case EXTERNAL_PROPERTY: return new AsExternalTypeSerializer(idRes, null, _typeProperty); case EXISTING_PROPERTY: // as per [#528] return new AsExistingPropertyTypeSerializer(idRes, null, _typeProperty); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }
@Override public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, true, false); switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeSerializer(idRes, null); case PROPERTY: return new AsPropertyTypeSerializer(idRes, null, _typeProperty); case WRAPPER_OBJECT: return new AsWrapperTypeSerializer(idRes, null); case EXTERNAL_PROPERTY: return new AsExternalTypeSerializer(idRes, null, _typeProperty); case EXISTING_PROPERTY: // as per [#528] return new AsExistingPropertyTypeSerializer(idRes, null, _typeProperty); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }
@Override public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } // 03-Oct-2016, tatu: As per [databind#1395] better prevent use for primitives, // regardless of setting if (baseType.isPrimitive()) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, true, false); switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeSerializer(idRes, null); case PROPERTY: return new AsPropertyTypeSerializer(idRes, null, _typeProperty); case WRAPPER_OBJECT: return new AsWrapperTypeSerializer(idRes, null); case EXTERNAL_PROPERTY: return new AsExternalTypeSerializer(idRes, null, _typeProperty); case EXISTING_PROPERTY: // as per [#528] return new AsExistingPropertyTypeSerializer(idRes, null, _typeProperty); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }
@Override public TypeSerializer buildTypeSerializer(SerializationConfig config, JavaType baseType, Collection<NamedType> subtypes) { if (_idType == JsonTypeInfo.Id.NONE) { return null; } // 03-Oct-2016, tatu: As per [databind#1395] better prevent use for primitives, // regardless of setting if (baseType.isPrimitive()) { return null; } TypeIdResolver idRes = idResolver(config, baseType, subtypes, true, false); switch (_includeAs) { case WRAPPER_ARRAY: return new AsArrayTypeSerializer(idRes, null); case PROPERTY: return new AsPropertyTypeSerializer(idRes, null, _typeProperty); case WRAPPER_OBJECT: return new AsWrapperTypeSerializer(idRes, null); case EXTERNAL_PROPERTY: return new AsExternalTypeSerializer(idRes, null, _typeProperty); case EXISTING_PROPERTY: // as per [#528] return new AsExistingPropertyTypeSerializer(idRes, null, _typeProperty); } throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: "+_includeAs); }