Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7621

camel-bindy - Two new properties to StringFormat through DataField: toUppercase and mapToASCII

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Implemented
    • None
    • 2.20.0
    • camel-bindy
    • None
    • Unknown

    Description

      We faced many times the need of converting string fields to uppercase and get rid of non-ASCII characters when interacting, using fixed-length files, with COBOL banking cores.
      So we decided to patch our own version of camel-bindy to add two new properties to DataField annotation:
      toUpperCase=<true|false> which converts, if its a String type field, content to uppercase.

      mapToASCII=<true|false> which maps, if its a String type field, content to 7-bit ASCII character mapping. Extended characters are currently mapped like this
      ä,â,á,à -> a (same for all vowels)
      ß -> b
      ç -> c
      ñ -> n

      Conversion uses a lookup table so it could be easily extended to other chars. This conversion only applies when marshalling. This feature has proven very useful to us when interacting with banking cores and one that repeatedly has to be recoded or reused. We love the annotation-driven model of bindy so decided to patch our own version and submit the patch hoping it would be as useful to others as it is to us.

      Attachments

        Issue Links

          Activity

            People

              onders Onder Sezgin
              bfontana Bruno Fontana
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: