package cn.common.page.converter;

import java.io.IOException;
import java.lang.reflect.Type;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.converter.HttpMessageNotWritableException;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import cn.util.core.LogKit;

/**
 * JsonResult<T> 序列化输出转换类
 */
public class Jackson2HttpMsg extends MappingJackson2HttpMessageConverter {
    public Jackson2HttpMsg() {
    	LogKit.info("load {}", this.getClass().getName());
    }

    @Override
    protected void writeInternal(final Object object, final Type type, final HttpOutputMessage outputMessage)
        throws IOException, HttpMessageNotWritableException {
        super.writeInternal(object, type, outputMessage);
    }

    @Override
    protected void writeInternal(final Object object, final HttpOutputMessage outputMessage)
        throws IOException, HttpMessageNotWritableException {
        this.writeInternal(object, null, outputMessage);
    }
}
