Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2064111DE6 for ; Wed, 20 Aug 2014 17:33:34 +0000 (UTC) Received: (qmail 1281 invoked by uid 500); 20 Aug 2014 17:33:33 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 1236 invoked by uid 500); 20 Aug 2014 17:33:33 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 1224 invoked by uid 99); 20 Aug 2014 17:33:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 17:33:33 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ch007m@gmail.com designates 209.85.192.169 as permitted sender) Received: from [209.85.192.169] (HELO mail-pd0-f169.google.com) (209.85.192.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 17:33:29 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so12126966pdj.0 for ; Wed, 20 Aug 2014 10:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oPppd3GY3HkP+lV0izLFVsmOocioG1HiTi7B9z7f94Y=; b=flTp97zrxCLHb7juNB10v3YEzHsQ2veIrshm4MIjoyBY0g7txAlQQ02A+/6EdYBZjW H2MRizKccxaVOV+TodghsU39xQBIxFVPsNoWjqitgE9gG1YCz0UTPqdCF8F14YY6F9Zx td3Mn7diWEH1XExjr4muYLLwCpA5ZikqGMi0ldcUmbnoDST+5d13a65ZTJ+b2xh6uAVW UTZLsR5wWx3ijcNSv6Xsvlljc3Cgdgovf48zziM9J5lSplsY+rfqlA1DfsmQEL/hBMYO BKHjvAn9e1j3M9P8svA7sp7OgcFTVAdT+BnHUWfQ1vhrAJlBrqgHlB38In3TP0Jglx38 n3nA== MIME-Version: 1.0 X-Received: by 10.70.36.4 with SMTP id m4mr60311016pdj.88.1408555985851; Wed, 20 Aug 2014 10:33:05 -0700 (PDT) Received: by 10.70.62.103 with HTTP; Wed, 20 Aug 2014 10:33:05 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 Aug 2014 19:33:05 +0200 Message-ID: Subject: Re: Camel Bindy: parse a BigDecimal number with a given pattern From: Charles Moulliard To: users@camel.apache.org Content-Type: multipart/alternative; boundary=089e0103de5c2edb33050112ff72 X-Virus-Checked: Checked by ClamAV on apache.org --089e0103de5c2edb33050112ff72 Content-Type: text/plain; charset=UTF-8 The @DataField of Camel bindy proposes the parameter precision like also a pattern but not a grouping separator Example @DataField(pos = 2, precision = 2, pattern = "00.00") private BigDecimal bigDecimal; Do you have an example to propose about such use case ? On Wed, Aug 20, 2014 at 3:43 PM, wrote: > Hello, > > I currently have a problem concerning Camel Bindy. I have a csv file that > should be parsed with Camel Bindy using a given model class. This csv file > contains a number that should be parsed as a BigDecimal. The problem is > that > this number contains a comma as a grouping separator and a point as the > decimal separator. > If I start the camel route the unmarshal process will throw a > NumberFormatException mentioning the invalid format of that number. So I > tried to add a pattern to the DataField annotation, but the error stays. > > After digging throw the documentation (http://camel.apache.org/bindy.html) > and the source code of FormatFactory > ( > http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.camel/camel-bindy/2.13.1/org/apache/camel/dataformat/bindy/FormatFactory.java/?v=source > ) > I'm a little bit confused, because the documentation mentions the ability > to > specify a grouping separator, but the source code shows that the pattern is > ignored for BigDecimal data types. > > Does anyone know how to specify that grouping separator? Or is this not > implemented yet? > > Many thanks in advance. > > Best regards. > Tom > > P.S. I also posted that question on stackoverflow > ( > http://stackoverflow.com/questions/25381052/camel-bindy-add-pattern-for-bigdecimal-type > ), > but with no luck yet. > > P.P.S. I posted that question using nabble.com ( > http://camel.465427.n5.nabble.com/Camel-Users-f465428.html) some moments > ago, but it seems that there is a problem with my mail provider that > doesn't allow services like this. So I'm sending this question directly > now. Sorry for any inconveniences. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io --089e0103de5c2edb33050112ff72--