Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-917

VTL Grammar Characters Configuration

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.2
    • Engine
    • None

    Description

      Experimental feature.

      The goal is to introduce new configuration parameters to be able to change the VTL grammar. For instance:

      parser.character.dollar = '~'
      parser.character.hash = '@'
      parser.character.arobase = '%'
      parser.character.star = '?'

      Requirements:

      + fully B.C.
      + done at runtime, without the need to recompile the parser
      + null impact on performance

      Implementation:

      1. Parametrize code that needs explicit references to those characters
      2. Define a ParserTokenManager interface and have the parser use this interface rather than a concrete class
      3. Use a custom class loader to patch the concrete token manager .class file, instantiate this custom token manager and initialize parsers with it

      The binary patch is prepared at compilation time (there will be one patch per JRE vendor and class file version).

      Due to the limited capability of this technique, the chosen characters are restricted to UTF-8 single bytes characters. Patches could be prepared for two-bytes or more characters, but there would be the need to have as many parser objects as variants in one/two/... characters combinations.

      Also, some characters and combinations are obviously invalid.

      Attachments

        Activity

          People

            cbrisson Claude Brisson
            cbrisson Claude Brisson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: