Repository: camel Updated Branches: refs/heads/master 8e75e6482 -> 28ef2272d
CAMEL-4917: The old way was better. A bit better docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/28ef2272 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/28ef2272 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/28ef2272 Branch: refs/heads/master Commit: 28ef2272d88348bb8da7f84e87d2be30dc06fb8b Parents: 8e75e64 Author: Claus Ibsen <davscl...@apache.org> Authored: Sat Jul 11 17:19:47 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat Jul 11 17:19:47 2015 +0200 ---------------------------------------------------------------------- .../camel/dataformat/bindy/BindyCsvFactory.java | 2 +- .../dataformat/bindy/annotation/DataField.java | 12 +++-------- .../simple/oneclassdifferentposition/Order.java | 22 ++++++++++---------- 3 files changed, 15 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/28ef2272/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java ---------------------------------------------------------------------- diff --git a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java index 2398f18..16a4263 100755 --- a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java +++ b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java @@ -432,7 +432,7 @@ public class BindyCsvFactory extends BindyAbstractFactory implements BindyFactor // Generate a key using the number of the section // and the position of the field Integer key1 = sections.get(obj.getClass().getName()); - Integer key2 = datafield.outPos() > 0 ? datafield.outPos() : datafield.position(); + Integer key2 = datafield.position(); Integer keyGenerated = generateKey(key1, key2); if (LOG.isDebugEnabled()) { http://git-wip-us.apache.org/repos/asf/camel/blob/28ef2272/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java ---------------------------------------------------------------------- diff --git a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java index 179e0dc..f7b2c8e 100755 --- a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java +++ b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java @@ -40,7 +40,7 @@ import java.lang.annotation.RetentionPolicy; public @interface DataField { /** - * Position of the data in the record, must start from 1 (mandatory). + * Position of the data in the input record, must start from 1 (mandatory). */ int pos(); @@ -90,19 +90,13 @@ public @interface DataField { int precision() default 0; /** - * Position of the field in the message generated (should start from 1) + * Position of the field in the output message generated (should start from 1) * - * @deprecated use {@link #outPos()} + * @see #pos() */ - @Deprecated int position() default 0; /** - * Position of the field in the message generated (should start from 1) - */ - int outPos() default 0; - - /** * Indicates if the field is mandatory */ boolean required() default false; http://git-wip-us.apache.org/repos/asf/camel/blob/28ef2272/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassdifferentposition/Order.java ---------------------------------------------------------------------- diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassdifferentposition/Order.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassdifferentposition/Order.java index 0c6c84d..d160117 100644 --- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassdifferentposition/Order.java +++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/oneclassdifferentposition/Order.java @@ -29,37 +29,37 @@ public class Order { // Positions of the fields start from 1 and not from 0 - @DataField(pos = 1, outPos = 11) + @DataField(pos = 1, position = 11) private int orderNr; - @DataField(pos = 2, outPos = 10) + @DataField(pos = 2, position = 10) private String clientNr; - @DataField(pos = 3, outPos = 9) + @DataField(pos = 3, position = 9) private String firstName; - @DataField(pos = 4, outPos = 8) + @DataField(pos = 4, position = 8) private String lastName; - @DataField(pos = 5, outPos = 7) + @DataField(pos = 5, position = 7) private String instrumentCode; - @DataField(pos = 6, outPos = 6) + @DataField(pos = 6, position = 6) private String instrumentNumber; - @DataField(pos = 7, outPos = 5) + @DataField(pos = 7, position = 5) private String orderType; - @DataField(name = "Name", pos = 8, outPos = 4) + @DataField(name = "Name", pos = 8, position = 4) private String instrumentType; - @DataField(pos = 9, precision = 2, outPos = 3) + @DataField(pos = 9, precision = 2, position = 3) private BigDecimal amount; - @DataField(pos = 10, outPos = 2) + @DataField(pos = 10, position = 2) private String currency; - @DataField(pos = 11, pattern = "dd-MM-yyyy", outPos = 1) + @DataField(pos = 11, pattern = "dd-MM-yyyy", position = 1) private Date orderDate; public int getOrderNr() {