All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icthh.xm.commons.permission.config.SpelSerializer Maven / Gradle / Ivy

There is a newer version: 4.0.17
Show newest version
package com.icthh.xm.commons.permission.config;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.springframework.expression.Expression;

import java.io.IOException;

public class SpelSerializer extends StdSerializer {

    public SpelSerializer() {
        this(null);
    }

    public SpelSerializer(Class sc) {
        super(sc);
    }

    @Override
    public void serialize(Expression value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        jgen.writeString(value.getExpressionString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy