public static <T> void writeTo(JsonGenerator generator, T message, Schema<T> schema,
            boolean numeric) throws IOException
    {
        generator.writeStartObject();

        final JsonOutput output = new JsonOutput(generator, numeric, schema);
        schema.writeTo(output, message);
        if (output.isLastRepeated())
            generator.writeEndArray();

        generator.writeEndObject();
    }
Serializes the {@code message} into a JsonGenerator using the given {@code schema}.
protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java