package com.ejie.m62fb.utils.serializers;

import java.io.IOException;
import java.math.BigDecimal;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;

import com.ejie.m62fb.utils.format.FormatUtils;


/**
 * JsonBigDecimalDeserializer.
 * 
XXXX
 */
public class JsonBigDecimalDeserializer extends JsonDeserializer<BigDecimal> {

	/**
	 * 
	 * @param jsonParser
	 *            JsonParser
	 * @param ctx
	 *            DeserializationContext
	 * @return BigDecimal
	 * @throws IOException
	 *             e
	 * @throws JsonProcessingException
	 *             e
	 * 
	 */
	@Override
	public BigDecimal deserialize(JsonParser jsonParser,
			DeserializationContext ctx) throws IOException,
			JsonProcessingException {
		return FormatUtils.convertirADecimal(jsonParser.getText());
	}
}