Bindy column name annotation?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Bindy column name annotation?

hakuseki
Good morning.

Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?

when marshalling to csv file

Thx

M
Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

gdaswani
Are you using it to parse CSV files?  or produce CSV files?

I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..

On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
Good morning.

Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?

when marshalling to csv file

Thx

M
Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

hakuseki
Used for creating CSV files with a hierarchy of objects using @Link annotation

I find it odd NOT having the option to name the column using annotation since you have control over other attributes…

M

> On 27 Aug 2019, at 18:52, George Daswani <[hidden email]> wrote:
>
> Are you using it to parse CSV files?  or produce CSV files?
>
> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..
>
> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
> Good morning.
>
> Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?
>
> when marshalling to csv file
>
> Thx
>
> M

Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

Claus Ibsen-2
Hi

Can you maybe provide a small example or sample code what you are looking for?

On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
<[hidden email]> wrote:

>
> Used for creating CSV files with a hierarchy of objects using @Link annotation
>
> I find it odd NOT having the option to name the column using annotation since you have control over other attributes…
>
> M
>
> > On 27 Aug 2019, at 18:52, George Daswani <[hidden email]> wrote:
> >
> > Are you using it to parse CSV files?  or produce CSV files?
> >
> > I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..
> >
> > On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
> > Good morning.
> >
> > Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?
> >
> > when marshalling to csv file
> >
> > Thx
> >
> > M
>


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

hakuseki
Sure, this is from camel web


@CsvRecord(separator = ",")
public class Order {

    @DataField(pos = 1)
    private int orderNr;

    @DataField(pos = 5)
    private String isinCode;

    @DataField(name = "Name", pos = 6)
    private String instrumentName;

    @DataField(pos = 7, precision = 2)
    private BigDecimal amount;

    @DataField(pos = 8)
    private String currency;

    // pattern used during parsing or when the date is created
    @DataField(pos = 9, pattern = "dd-MM-yyyy")
    private Date orderDate;
}




> On 30 Aug 2019, at 13:45, Claus Ibsen <[hidden email]> wrote:
>
> Hi
>
> Can you maybe provide a small example or sample code what you are looking for?
>
> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
> <[hidden email]> wrote:
>>
>> Used for creating CSV files with a hierarchy of objects using @Link annotation
>>
>> I find it odd NOT having the option to name the column using annotation since you have control over other attributes…
>>
>> M
>>
>>> On 27 Aug 2019, at 18:52, George Daswani <[hidden email]> wrote:
>>>
>>> Are you using it to parse CSV files?  or produce CSV files?
>>>
>>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..
>>>
>>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
>>> Good morning.
>>>
>>> Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?
>>>
>>> when marshalling to csv file
>>>
>>> Thx
>>>
>>> M
>>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

Claus Ibsen-2
So are you saying you are looking for a new attribure on the
annotation where you can set the column header name?

@DataField(headerName="myName" ...)
private String foo;


On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
<[hidden email]> wrote:

>
> Sure, this is from camel web
>
>
> @CsvRecord(separator = ",")
> public class Order {
>
>     @DataField(pos = 1)
>     private int orderNr;
>
>     @DataField(pos = 5)
>     private String isinCode;
>
>     @DataField(name = "Name", pos = 6)
>     private String instrumentName;
>
>     @DataField(pos = 7, precision = 2)
>     private BigDecimal amount;
>
>     @DataField(pos = 8)
>     private String currency;
>
>     // pattern used during parsing or when the date is created
>     @DataField(pos = 9, pattern = "dd-MM-yyyy")
>     private Date orderDate;
> }
>
>
>
>
> > On 30 Aug 2019, at 13:45, Claus Ibsen <[hidden email]> wrote:
> >
> > Hi
> >
> > Can you maybe provide a small example or sample code what you are looking for?
> >
> > On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
> > <[hidden email]> wrote:
> >>
> >> Used for creating CSV files with a hierarchy of objects using @Link annotation
> >>
> >> I find it odd NOT having the option to name the column using annotation since you have control over other attributes…
> >>
> >> M
> >>
> >>> On 27 Aug 2019, at 18:52, George Daswani <[hidden email]> wrote:
> >>>
> >>> Are you using it to parse CSV files?  or produce CSV files?
> >>>
> >>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..
> >>>
> >>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
> >>> Good morning.
> >>>
> >>> Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?
> >>>
> >>> when marshalling to csv file
> >>>
> >>> Thx
> >>>
> >>> M
> >>
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

hakuseki
Yes that is correct.
I was under the impression it was there but I might confuse myself from jsonproperty in Jackson.

However it would be a huge benefit if added.

// Mikael Andersson Wigander


> 31 aug. 2019 kl. 08:34 skrev Claus Ibsen <[hidden email]>:
>
> So are you saying you are looking for a new attribure on the
> annotation where you can set the column header name?
>
> @DataField(headerName="myName" ...)
> private String foo;
>
>
> On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
> <[hidden email]> wrote:
>>
>> Sure, this is from camel web
>>
>>
>> @CsvRecord(separator = ",")
>> public class Order {
>>
>>    @DataField(pos = 1)
>>    private int orderNr;
>>
>>    @DataField(pos = 5)
>>    private String isinCode;
>>
>>    @DataField(name = "Name", pos = 6)
>>    private String instrumentName;
>>
>>    @DataField(pos = 7, precision = 2)
>>    private BigDecimal amount;
>>
>>    @DataField(pos = 8)
>>    private String currency;
>>
>>    // pattern used during parsing or when the date is created
>>    @DataField(pos = 9, pattern = "dd-MM-yyyy")
>>    private Date orderDate;
>> }
>>
>>
>>
>>
>>> On 30 Aug 2019, at 13:45, Claus Ibsen <[hidden email]> wrote:
>>>
>>> Hi
>>>
>>> Can you maybe provide a small example or sample code what you are looking for?
>>>
>>> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
>>> <[hidden email]> wrote:
>>>>
>>>> Used for creating CSV files with a hierarchy of objects using @Link annotation
>>>>
>>>> I find it odd NOT having the option to name the column using annotation since you have control over other attributes…
>>>>
>>>> M
>>>>
>>>>> On 27 Aug 2019, at 18:52, George Daswani <[hidden email]> wrote:
>>>>>
>>>>> Are you using it to parse CSV files?  or produce CSV files?
>>>>>
>>>>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with the first being it doesn't properly support RFC-4180 CSV files, and the second being it uses reflection to set properties..
>>>>>
>>>>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <[hidden email]<mailto:[hidden email]>> wrote:
>>>>> Good morning.
>>>>>
>>>>> Using Bindy dataformat, in the documentation nothing states how to set column name but some example has the name attribute given as if possible to set the name of the column header to anything other than the field name. This appartently doesn’t work so question is, is it possible?
>>>>>
>>>>> when marshalling to csv file
>>>>>
>>>>> Thx
>>>>>
>>>>> M
>>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Bindy column name annotation?

Claus Ibsen-2
You are welcome to create a JIRA ticket and if possible work on coding this
feature

On Sat, 31 Aug 2019 at 14.09, Mikael Grevsten <[hidden email]>
wrote:

> Yes that is correct.
> I was under the impression it was there but I might confuse myself from
> jsonproperty in Jackson.
>
> However it would be a huge benefit if added.
>
> // Mikael Andersson Wigander
>
>
> > 31 aug. 2019 kl. 08:34 skrev Claus Ibsen <[hidden email]>:
> >
> > So are you saying you are looking for a new attribure on the
> > annotation where you can set the column header name?
> >
> > @DataField(headerName="myName" ...)
> > private String foo;
> >
> >
> > On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
> > <[hidden email]> wrote:
> >>
> >> Sure, this is from camel web
> >>
> >>
> >> @CsvRecord(separator = ",")
> >> public class Order {
> >>
> >>    @DataField(pos = 1)
> >>    private int orderNr;
> >>
> >>    @DataField(pos = 5)
> >>    private String isinCode;
> >>
> >>    @DataField(name = "Name", pos = 6)
> >>    private String instrumentName;
> >>
> >>    @DataField(pos = 7, precision = 2)
> >>    private BigDecimal amount;
> >>
> >>    @DataField(pos = 8)
> >>    private String currency;
> >>
> >>    // pattern used during parsing or when the date is created
> >>    @DataField(pos = 9, pattern = "dd-MM-yyyy")
> >>    private Date orderDate;
> >> }
> >>
> >>
> >>
> >>
> >>> On 30 Aug 2019, at 13:45, Claus Ibsen <[hidden email]> wrote:
> >>>
> >>> Hi
> >>>
> >>> Can you maybe provide a small example or sample code what you are
> looking for?
> >>>
> >>> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
> >>> <[hidden email]> wrote:
> >>>>
> >>>> Used for creating CSV files with a hierarchy of objects using @Link
> annotation
> >>>>
> >>>> I find it odd NOT having the option to name the column using
> annotation since you have control over other attributes…
> >>>>
> >>>> M
> >>>>
> >>>>> On 27 Aug 2019, at 18:52, George Daswani <[hidden email]>
> wrote:
> >>>>>
> >>>>> Are you using it to parse CSV files?  or produce CSV files?
> >>>>>
> >>>>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of
> problems with the first being it doesn't properly support RFC-4180 CSV
> files, and the second being it uses reflection to set properties..
> >>>>>
> >>>>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <
> [hidden email]<mailto:[hidden email]>> wrote:
> >>>>> Good morning.
> >>>>>
> >>>>> Using Bindy dataformat, in the documentation nothing states how to
> set column name but some example has the name attribute given as if
> possible to set the name of the column header to anything other than the
> field name. This appartently doesn’t work so question is, is it possible?
> >>>>>
> >>>>> when marshalling to csv file
> >>>>>
> >>>>> Thx
> >>>>>
> >>>>> M
> >>>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> http://davsclaus.com @davsclaus
> >>> Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2