Class StdJdkSerializers.ClassSerializer

  • All Implemented Interfaces:
    SchemaAware
    Enclosing class:
    StdJdkSerializers

    public static final class StdJdkSerializers.ClassSerializer
    extends ScalarSerializerBase<java.lang.Class<?>>
    Also: default bean access will not do much good with Class.class. But we can just serialize the class name and that should be enough.
    • Constructor Detail

      • ClassSerializer

        public ClassSerializer()
    • Method Detail

      • serialize

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