camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1172813 - in /camel/branches/camel-2.8.x: ./ components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/ components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/ components/camel-bindy/src/test/java/org/apach...
Date Mon, 19 Sep 2011 20:54:51 GMT
Author: dkulp
Date: Mon Sep 19 20:54:51 2011
New Revision: 1172813

URL: http://svn.apache.org/viewvc?rev=1172813&view=rev
Log:
Merged revisions 1158143 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1158143 | davsclaus | 2011-08-16 04:05:45 -0400 (Tue, 16 Aug 2011) | 1 line
  
  CAMEL-4337: Bindy in CSV format now uses trim, clip, and length attributes on @DataField
when marshalling. Thanks to Reinhard Luft for the patch.
........

Added:
    camel/branches/camel-2.8.x/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTrimClipTest.java
      - copied unchanged from r1158143, camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTrimClipTest.java
    camel/branches/camel-2.8.x/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassandtrimandclip/
      - copied from r1158143, camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassandtrimandclip/
    camel/branches/camel-2.8.x/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassandtrimandclip/Customer.java
      - copied unchanged from r1158143, camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassandtrimandclip/Customer.java
    camel/branches/camel-2.8.x/components/camel-bindy/src/test/resources/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTrimClipTest-context.xml
      - copied unchanged from r1158143, camel/trunk/components/camel-bindy/src/test/resources/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTrimClipTest-context.xml
Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java?rev=1172813&r1=1172812&r2=1172813&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
Mon Sep 19 20:54:51 2011
@@ -388,6 +388,14 @@ public class BindyCsvFactory extends Bin
 
                     result = formatString(format, value);
 
+                    if (datafield.trim()) {
+                        result = result.trim();
+                    }
+
+                    if (datafield.clip() && result.length() > datafield.length())
{
+                        result = result.substring(0, datafield.length());
+                    }
+
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Value to be formatted: {}, position: {}, and its formatted
value: {}", new Object[]{value, datafield.pos(), result});
                     }



Mime
View raw message