Skip to content

Conversation

@rousso
Copy link
Contributor

@rousso rousso commented Jun 29, 2025

  • Introduced renderDictionaryDeclaration method in MarkupGenerator.
  • Added composeDictionaryLookup method in ScriptGenerator and XPathScriptGenerator.
  • Implemented getDictionary method in CallStack to retrieve dictionaries.
  • Created Dictionary class to encapsulate dictionary properties.
  • Enhanced EfxTemplateTranslatorV2 to support dictionary declarations and lookups.
  • Updated tests to validate dictionary declaration and usage.

- Introduced renderDictionaryDeclaration method in MarkupGenerator.
- Added composeDictionaryLookup method in ScriptGenerator and XPathScriptGenerator.
- Implemented getDictionary method in CallStack to retrieve dictionaries.
- Created Dictionary class to encapsulate dictionary properties.
- Enhanced EfxTemplateTranslatorV2 to support dictionary declarations and lookups.
- Updated tests to validate dictionary declaration and usage.
@rousso rousso self-assigned this Jun 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for declaring and looking up dictionaries in both markup and script generation, updates translators and call stack, and includes corresponding tests.

  • Introduces a Dictionary model and CallStack.getDictionary for registry access
  • Extends MarkupGenerator and ScriptGenerator interfaces with dictionary methods and updates their implementations
  • Updates EfxTemplateTranslatorV2 and EfxExpressionTranslatorV2 to emit dictionary declarations and lookups, plus tests

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
EfxTemplateTranslatorV2Test.java Adds test for global dictionary declaration
MarkupGeneratorMock.java Implements mock renderDictionaryDeclaration
XPathScriptGenerator.java Adds composeDictionaryLookup implementation
EfxTemplateTranslatorV2.java Handles dictionary declaration in parser listener
EfxExpressionTranslatorV2.java Emits dictionary lookup expressions
Dictionary.java New Dictionary class with fields and equals()
CallStack.java Adds getDictionary method
ScriptGenerator.java Declares composeDictionaryLookup
MarkupGenerator.java Declares renderDictionaryDeclaration
Comments suppressed due to low confidence (3)

src/main/java/eu/europa/ted/efx/interfaces/MarkupGenerator.java:84

  • [nitpick] The comment has a typo/extra word: change "declare a and initialise" to "declare and initialise" and remove the extra space before the period.
     * Renders the markup necessary to declare a and initialise a dictionary .

src/main/java/eu/europa/ted/efx/sdk2/EfxTemplateTranslatorV2.java:1290

  • There is no test covering the dictionary declaration path in the exitTemplateLine (inline dictionary) listener. Consider adding a test for inline/simple-field dictionary declarations.
    public void exitDictionaryDeclaration(DictionaryDeclarationContext ctx) {

src/main/java/eu/europa/ted/efx/interfaces/ScriptGenerator.java:119

  • Ensure that all implementations of ScriptGenerator (e.g., any mock or additional language generators) are updated to implement this new method to prevent broken builds.
  public <T extends TypedExpression> T composeDictionaryLookup(String dictionaryName, StringExpression keyExpression, Class<T> type);

@rousso rousso merged commit 11b7ee0 into develop Jun 30, 2025
1 of 2 checks passed
@rousso rousso deleted the TEDEFO-4273-use-xsl-key branch June 30, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants