camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Peter Strandberg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-4108) Add more flexibility to DataField
Date Wed, 15 Jun 2011 18:52:47 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-4108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Niels Peter Strandberg updated CAMEL-4108:
------------------------------------------

    Description: 
1) Add a "toEnd" to the DateField:

CSV file:
{code}
w,RegionH,1234,4567,5565
w,KIT,233,233
d,Rigshospitalet
{code}

The model:

{code}
@CsvRecord(separator = ",")
public class Org {

   @DataField(pos = 1)
   private String type;
	
   @DataField(pos = 2)
   private String name;

   @DataField(pos = 3, toEnd = true)
   private List<Integer> ids;

}
{code}

The "ids" list will the contain the result for pos 3 to the end of the line. 



2) Add a "endPos" to the DateField:

CSV file:

{code}
w,RegionH,1234,4567,5565,m
w,KIT,233,233,4545,m
d,Rigshospitalet,343434,3434,3434,r
{code}

The model:

{code}
@CsvRecord(separator = ",")
public class Org {

   @DataField(pos = 1)
   private String type;

   @DataField(pos = 2)
   private String name;

   @DataField(pos = 3, endPos = 5)
    private List<Integer> ids;

   @DataField(pos = 6)
   private String action;

}
{code}

The "ids" list will the contain the result for pos 3 to 5. 


I have a prototype for the unmarshalling.

/Niels Peter Strandberg

  was:
1) Add a "toEnd" to the DateField:

CSV file:
{code}
w,RegionH,1234,4567,5565
w,KIT,233,233
d,Rigshospitalet
{code}

The model:

{code}
@CsvRecord(separator = ",")
public class Org {

   @DataField(pos = 1)
   private String type;
	
   @DataField(pos = 2)
   private String name;

   @DataField(pos = 3, toEnd = true)
   private List<Integer> ids;

}
{code}

The "ids" list will the contain the result for pos 3 to the end of the line. 



2) Add a "endPos" to the DateField:

CSV file:

{code}
w,RegionH,1234,4567,5565,m
w,KIT,233,233,4545,m
d,Rigshospitalet,343434,3434,3434,r
{code}

The model:

{code}
@CsvRecord(separator = ",")
public class Org {

   @DataField(pos = 1)
   private String type;

   @DataField(pos = 2)
   private String name;

   @DataField(pos = 3, endPos = 5)
    private List<Integer> ids;

   @DataField(pos = 6)
   private String action;

}
{code}

The "ids" list will the contain the result for pos 3 to 5. 


I have a prototype for the unmarshalling, but not for unmarshalling.

/Niels Peter Strandberg


> Add more flexibility to DataField
> ---------------------------------
>
>                 Key: CAMEL-4108
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4108
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-bindy
>            Reporter: Niels Peter Strandberg
>            Priority: Minor
>
> 1) Add a "toEnd" to the DateField:
> CSV file:
> {code}
> w,RegionH,1234,4567,5565
> w,KIT,233,233
> d,Rigshospitalet
> {code}
> The model:
> {code}
> @CsvRecord(separator = ",")
> public class Org {
>    @DataField(pos = 1)
>    private String type;
> 	
>    @DataField(pos = 2)
>    private String name;
>    @DataField(pos = 3, toEnd = true)
>    private List<Integer> ids;
> }
> {code}
> The "ids" list will the contain the result for pos 3 to the end of the line. 
> 2) Add a "endPos" to the DateField:
> CSV file:
> {code}
> w,RegionH,1234,4567,5565,m
> w,KIT,233,233,4545,m
> d,Rigshospitalet,343434,3434,3434,r
> {code}
> The model:
> {code}
> @CsvRecord(separator = ",")
> public class Org {
>    @DataField(pos = 1)
>    private String type;
>    @DataField(pos = 2)
>    private String name;
>    @DataField(pos = 3, endPos = 5)
>     private List<Integer> ids;
>    @DataField(pos = 6)
>    private String action;
> }
> {code}
> The "ids" list will the contain the result for pos 3 to 5. 
> I have a prototype for the unmarshalling.
> /Niels Peter Strandberg

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message