Class StringSerializer

  • All Implemented Interfaces:
    SchemaAware

    public final class StringSerializer
    extends NonTypedScalarSerializerBase<java.lang.String>
    This is the special serializer for regular Strings.

    Since this is one of "native" types, no type information is ever included on serialization (unlike for most scalar types as of 1.5)

    • Constructor Detail

      • StringSerializer

        public StringSerializer()
    • Method Detail

      • serialize

        public void serialize​(java.lang.String value,
                              JsonGenerator jgen,
                              SerializerProvider provider)
                       throws java.io.IOException,
                              JsonGenerationException
        Description copied from class: JsonSerializer
        Method that can be called to ask implementation to serialize values of type this serializer handles.
        Specified by:
        serialize in class SerializerBase<java.lang.String>
        Parameters:
        value - Value to serialize; can not be null.
        jgen - Generator used to output resulting Json content
        provider - Provider that can be used to get serializers for serializing Objects value contains, if any.
        Throws:
        java.io.IOException
        JsonGenerationException