package com.njcn.pojo.advanced;

import net.sf.json.JSONObject;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class EncoderMsg implements Encoder.Text<MessageObj>{

	@Override
	public void init(EndpointConfig config) {
		
	}

	@Override
	public void destroy() {
		
	}

	@Override
	public String encode(MessageObj object) throws EncodeException {
		return JSONObject.fromObject(object).toString();
	}

}
