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

Rich Newcomb updated CAMEL-6039:
--------------------------------

    Attachment: CAMEL-6039.patch3

Attached is a supplemental patch (patch3) & unit tests for an edge case that 
was not fully handled in the initial entry for this ticket.  

The patch causes Bindy to throw an exception when non-mapped, extraneous data 
is encountered at the end of a parsed fixed-length record. This behavior 
parallels the behavior for absolute fixed-length records, where the record 
length is declared up front and an exception was thrown if the length of the 
parsed line does not match that length.  It follows that an exception should 
also be thrown for records with variable-length elements (e.g. delimited, or 
dynamically-defined field length) when it is determined that more data is 
presented on a line than was declared for the record.

I will add a callout in the documentation to explain this behavior / 
requirement once the patch is applied.

                
> camel-bindy fixed length record improvements
> --------------------------------------------
>
>                 Key: CAMEL-6039
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6039
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-bindy
>    Affects Versions: 2.11.0
>            Reporter: Rich Newcomb
>             Fix For: 2.11.0
>
>         Attachments: CAMEL-6039.patch, CAMEL-6039.patch2, CAMEL-6039.patch3
>
>
> The attached patch provides the following improvements for the camel-bindy 
> fixed length record data format:
>  * full support for fixed-length header and footer records
>  * allows delimited (variable length) fields to be defined within 
> "fixed-length" records
>  * enables the length of a data field to be defined dynamically by another 
> field in the same record
>  * fixed-length records can be defined using ordinal / relative pos values
> New annotation properties:
> ------------------
> *@DataField*
>  + lengthPos (int) -- Optionally identifies a data field in the record that 
> defines the fixed length for this field
>  + delimiter (String) -- Optional delimiter to be used if this field has a 
> variable length
> *@FixedLengthRecord*
>  + hasHeader (boolean) -- Indicates that the record(s) of this type may be 
> preceded by a single header record at the beginning of the file / stream
>  + hasFooter (boolean) -- Indicates that the record(s) of this type may be 
> followed by a single footer record at the end of the file / stream
>  + skipHeader (boolean) -- Configures the data format to skip marshalling / 
> unmarshalling of the header record
>  + skipFooter (boolean) -- Configures the data format to skip marshalling / 
> unmarshalling of the footer record
>  + isHeader (boolean) -- Identifies this FixedLengthRecord as a header record
>  + isFooter (boolean) -- Identifies this FixedLengthRecord as a footer record 
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to