Class StdSerializers.BooleanSerializer

  • All Implemented Interfaces:
    SchemaAware
    Enclosing class:
    StdSerializers

    public static final class StdSerializers.BooleanSerializer
    extends NonTypedScalarSerializerBase<java.lang.Boolean>
    Serializer used for primitive boolean, as well as java.util.Boolean wrapper type.

    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

      • BooleanSerializer

        public BooleanSerializer​(boolean forPrimitive)
    • Method Detail

      • serialize

        public void serialize​(java.lang.Boolean 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.Boolean>
        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