Tedefo 4367 adds global variables and functions#112
Merged
Conversation
Also fixed some issues reported by SonarQube.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements global variables and functions support as part of Tedefo 4367 by refactoring identifier management and enhancing translator interfaces.
- Removed redundant parameter composition calls in EfxExpressionTranslatorV1.
- Introduced global identifier and function registries and added related utility methods in Context.
- Enhanced several interfaces (ScriptGenerator, MarkupGenerator, TranslatorOptions, and EfxTranslator) with new methods and documentation to support global functions and user-defined function namespaces.
Reviewed Changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/eu/europa/ted/efx/sdk1/EfxExpressionTranslatorV1.java | Removed redundant calls for parameter declaration/reference composition. |
| src/main/java/eu/europa/ted/efx/model/variables/Variable.java | Adjusted constructor and field initialization ordering. |
| src/main/java/eu/europa/ted/efx/model/variables/ParameterList.java | Introduced new container for parameters. |
| src/main/java/eu/europa/ted/efx/model/variables/Parameter.java | Updated to use a single field (referenceExpression) and modified equality/hashCode implementations. |
| src/main/java/eu/europa/ted/efx/model/variables/Identifier.java | Changed to an abstract class with improved documentation. |
| src/main/java/eu/europa/ted/efx/model/variables/Function.java | Added global function representation. |
| src/main/java/eu/europa/ted/efx/model/Context.java | Added global registries and related methods for identifiers and functions. |
| src/main/java/eu/europa/ted/efx/interfaces/ScriptGenerator.java, MarkupGenerator.java | Updated with new methods for global function and variable declaration support. |
| src/main/java/eu/europa/ted/efx/EfxTranslatorOptions.java, EfxTranslator.java | Enhanced options and translation flows with UDF namespace configuration and new overloaded translateTemplate methods. |
Files not reviewed (1)
- pom.xml: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Use Objects.equals() and Objects.hash() instead of doing it ourselves, and use all member variables. Also make sure we use the result from the super class if there is one.
The commit was suggested by Copilot, but it removed the closing of the javadoc comment...
bertrand-lorentz
approved these changes
Apr 22, 2025
Contributor
bertrand-lorentz
left a comment
There was a problem hiding this comment.
Look OK for me now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.