-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Custom placeholders #12
Merged
Merged
Conversation
This file contains 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
To be able to add custom placeholders from outside of the generator infrastructure allowing this should be created (gh issue #26) This commit introduces a first draft for it. The way this works is by having a registry where custom placeholder resolvers (of type `PlaceholderType.Custom`) can be registered. When the resolver is passed a placeholder to resolve, it now consults this registry whether it has a resolver for it registered, and if it does it returns an `Optional` of the corresponding class. The registry is passed to the resolver on first creation, and subsequently gets passed to the recursive instantiations. Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
Until now, test relied on manually review the documents, which led to a number of errors staying undiscovered in the library. This commit automates a big number of the tests with the help of `poipath` Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
# Conflicts: # src/main/java/com/docutools/jocument/impl/ReflectionResolver.java
alexpartsch
moved this from To do
to In progress
in Release First Major Version of jocument
Sep 23, 2020
# Conflicts: # build.gradle # src/test/java/com/docutools/jocument/TestUtils.java
This commit adds the path to the poipath github maven repo Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
This commit refactors to fix problems found during the first review of this branch. Those are: * Naming * Running automated tests via tag * Workbook closing * Test minimization * Additional tests for nested loops and pictures Additionally , the path and version of poipath were updated Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
This commit adds automated testing to the github action which is triggered on every push Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
Since the formatting of the birthdate of a person was not fixed, it was difficult to reproduce the birthdate string correctly in testing. This commit fixes the formatting to "dd.MM.yyyy", so this is easier Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
# Conflicts: # src/main/java/com/docutools/jocument/impl/ReflectionResolver.java
Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
This commit implements a test to test and demonstrate the custom placeholder implementation. Additionally the old table of contents test was removed Signed-off-by: Anton Oellerer <a.oellerer@docu-tools.com>
AntonOellerer
moved this from In progress
to To review
in Release First Major Version of jocument
Oct 9, 2020
alexpartsch
approved these changes
Oct 12, 2020
alexpartsch
moved this from To review
to Done
in Release First Major Version of jocument
Oct 12, 2020
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.
Add custom placeholder infrastructure
To be able to add custom placeholders from outside of the
generator, infrastructure allowing this should be created
(#10 ).
In this MR, the current implementation approach is discussed.
The way this works is by having a registry where custom
placeholder resolvers (of type
PlaceholderType.Custom
) canbe registered.
When the resolver is passed a placeholder to resolve, the
resolver now consults the registry on whether it has a
resolver for the placeholder registered, and if it does it
accesses it a second time to retrieve an
Optional
of thecorresponding class.
The registry is passed to the resolver on first creation, and
subsequently gets passed to the recursive instantiations.