Velocity
  1. Velocity
  2. VELOCITY-549

Allow directives to detect whether literals are constant

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      Add isConstant() method to ASTStringLiteral, which exposes interpolate, so that calling code can detect constant string literals.

        Activity

        Hide
        Will Glass-Husain added a comment -

        A simple patch, don't mind applying it, but I'm not sure I understand why this is needed. Can you give a use case when this would be helpful?

        Show
        Will Glass-Husain added a comment - A simple patch, don't mind applying it, but I'm not sure I understand why this is needed. Can you give a use case when this would be helpful?
        Hide
        Adam Heath added a comment -

        If a directive implementation sees it's parameters are constant, it could evaluate them at initialization time, and substitute a more efficient version for evaluation at runtime.

        Show
        Adam Heath added a comment - If a directive implementation sees it's parameters are constant, it could evaluate them at initialization time, and substitute a more efficient version for evaluation at runtime.
        Hide
        Will Glass-Husain added a comment -

        patch applied.

        Show
        Will Glass-Husain added a comment - patch applied.

          People

          • Assignee:
            Unassigned
            Reporter:
            Adam Heath
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development