camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suresh_camel <>
Subject EDIFACT EJC Maven Plugin Cofiguration for Custom Decoders
Date Mon, 25 Nov 2013 06:37:32 GMT
 UN/EDIFACT Interchange Processing with Smooks v1.5.1 where i have to
configure the "Custom Decoder for DataTypes"


For Eg: I need to configure the following Decoder for BigDecimal Type.

import java.math.BigDecimal;
import org.milyn.edisax.model.internal.Delimiters;
import org.milyn.javabean.DataDecodeException;
import org.milyn.javabean.DecodeType;
import org.milyn.javabean.decoders.DABigDecimalDecoder;

public class EDIBigDecimalDecoder extends DABigDecimalDecoder{
	private static final long serialVersionUID = 337613680383128890L;
	   public String encode(Object object) throws DataDecodeException {
		   String format = super.encode(object);
		   Delimiters delimiters = super.getContextDelimiters();
		   String[] str = format.split(delimiters.getDecimalSeparator());
		   if(str.length > 1){
			   int intVal = Integer.parseInt(str[1]);
			   if(intVal > 0){
				   return format;
                           return str[0];
		   return format;

Kindly Assist me.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message