Skip to content

Commit a159254

Browse files
authored
Allow multiple translation engines; Taskit 3.0.0 (#4)
* initial design impl fix and add tests * Update README.md * Update README.md * move translators to translation engine * add parentchildmap to engine add missing tests jacoco back to 100% * fix translation engine builder inheritance issue * fix for tests * method scope reduction where possible * update engine to use paths instead of readers * update engine to use paths instead of writers * update to 3.0.0 proper
1 parent 83e859b commit a159254

27 files changed

+1344
-996
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[![GPL LICENSE][license-shield]][license-url]
2+
[![GitHub tag (with filter)][tag-shield]][tag-url]
23
[![GitHub contributors][contributors-shield]][contributors-url]
4+
[![GitHub Workflow Status (with event)][dev-build-shield]][dev-build-url]
5+
[![GitHub Workflow Status (with event)][build-shield]][build-url]
36

47
# Translation And Serialization Toolkit
58
A toolkit made to help with converting between input files and Java Objects. This will herein be reffered to as Taskit.
@@ -46,8 +49,7 @@ See [TestObject](protobuf/src/main/proto/gov/hhs/aspr/ms/taskit/protobuf/testobj
4649
- Modeling Util located [here](https://github.com/HHS/ASPR-ms-util)
4750

4851
## Building
49-
To build, first navigate into the ```core``` directory and run the command ```mvn clean install```
50-
Then go into the ```protobuf``` directory and run the command ```mvn clean install```
52+
To build, navigate into the root directory and run the command ```mvn clean install```
5153

5254
## Documentation
5355
Documentation has yet to be created. In the interim, the code is mostly commented and the javadocs do provide good detail with regards to method and class expectations.
@@ -59,7 +61,12 @@ Distributed under the GPLv3 License. See [LICENSE](LICENSE) for more information
5961
<!-- MARKDOWN LINKS & IMAGES -->
6062
[contributors-shield]: https://img.shields.io/github/contributors/HHS/ASPR-ms-taskit
6163
[contributors-url]: https://github.com/HHS/ASPR-ms-taskit/graphs/contributors
62-
<!-- [tag-shield]: https://img.shields.io/github/v/tag/HHS/ASPR-ms-util -->
63-
<!-- [tag-url]: https://github.com/HHS/ASPR-8/releases/tag/v4.0.0-RC1 -->
64+
[tag-shield]: https://img.shields.io/github/v/tag/HHS/ASPR-ms-taskit
65+
[tag-url]: https://github.com/HHS/ASPR-ms-taskit/releases/latest
6466
[license-shield]: https://img.shields.io/github/license/HHS/ASPR-ms-taskit
6567
[license-url]: LICENSE
68+
[dev-build-shield]: https://img.shields.io/github/actions/workflow/status/HHS/ASPR-ms-taskit/dev-pre-mavencentral.yml?label=dev-build
69+
[dev-build-url]: https://github.com/HHS/ASPR-ms-taskit/actions/workflows/dev-pre-mavencentral.yml
70+
[build-shield]: https://img.shields.io/github/actions/workflow/status/HHS/ASPR-ms-taskit/create_release_on_tag.yml?label=release-build
71+
[build-url]: https://github.com/HHS/ASPR-ms-taskit/actions/workflows/create_release_on_tag.yml
72+

core/src/main/java/gov/hhs/aspr/ms/taskit/core/CoreTranslationError.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,43 @@
44

55
public enum CoreTranslationError implements ContractError {
66

7+
CIRCULAR_TRANSLATOR_DEPENDENCIES("Circular translator dependencies: "),
8+
DUPLICATE_CLASSREF("Duplicate ClassRef"),
9+
DUPLICATE_CLASSREF_SCENARIO_PAIR("Duplicate ClassRef and Scenario Pair"),
10+
DUPLICATE_DEPENDENCY("Duplicate Dependency"),
11+
DUPLICATE_INPUT_PATH("Duplicate Input Path"),
12+
DUPLICATE_OUTPUT_PATH("Duplicate Output Path"),
13+
DUPLICATE_TRANSLATOR("Duplicate Translator"),
14+
DUPLICATE_TRANSLATION_SPEC("Duplicate TranslationSpec"),
15+
INVALID_TRANSLATION_ENGINE_CLASS_REF(
16+
"The given Translation Engine classRef does not match the class of the actual Translation Engine"),
17+
INVALID_TRANSLATION_ENGINE_BUILDER_CLASS_REF(
18+
"The given Translation Engine Builder classRef does not match the class of the actual Translation Engine Builder"),
19+
INVALID_OUTPUT_CLASSREF("The given class does not have a output file path associated with it."),
20+
INVALID_OUTPUT_PATH(
21+
"The given output file path does not exist. While the file will be created on write, the directory will not."),
22+
INVALID_INPUT_PATH("The given input file path does not exist"),
23+
MISSING_TRANSLATOR("Missing Translator: "),
24+
NO_TRANSLATION_ENGINES("There are no translation engines added to this controller."),
725
NULL_TRANSLATOR_ID("Null TranslatorId"),
826
NULL_TRANSLATOR("Null Translator"),
927
NULL_TRANSLATION_ENGINE_BUILDER("Null Translation Engine Builder"),
1028
NULL_TRANSLATION_ENGINE("Null Translation Engine"),
1129
NULL_OBJECT_FOR_TRANSLATION("The object to be translated was null"),
12-
INVALID_TRANSLATION_ENGINE(
13-
"The given Translation Engine classRef does not match the class of the actual Translation Engine"),
14-
INVALID_TRANSLATION_ENGINE_BUILDER(
15-
"The given Translation Engine Builder classRef does not match the class of the actual Translation Engine Builder"),
16-
DUPLICATE_TRANSLATOR("Duplicate Translator"),
17-
MISSING_TRANSLATOR("Missing Translator: "),
18-
CIRCULAR_TRANSLATOR_DEPENDENCIES("Circular translator dependencies: "),
1930
NULL_INIT_CONSUMER("Null Initilizer Consumer"),
2031
NULL_DEPENDENCY("Null dependency"),
21-
DUPLICATE_DEPENDENCY("Duplicate Dependency"),
2232
NULL_PATH("Null Path"),
23-
DUPLICATE_INPUT_PATH("Duplicate Input Path"),
24-
INVALID_INPUT_PATH("The given input file path does not exist"),
2533
NULL_CLASS_REF("Null Class Ref"),
26-
INVALID_OUTPUT_CLASSREF("The given class does not have a output file path associated with it."),
27-
DUPLICATE_OUTPUT_PATH("Duplicate Output Path"),
28-
INVALID_OUTPUT_PATH(
29-
"The given output file path does not exist. While the file will be created on write, the directory will not."),
30-
DUPLICATE_CLASSREF_SCENARIO_PAIR("Duplicate ClassRef and Scenario Pair"),
31-
DUPLICATE_CLASSREF("Duplicate ClassRef"),
32-
UNKNOWN_CLASSREF("No object has been read in with the specified classRef"),
3334
NULL_TRANSLATION_SPEC("Null TranslationSpec"),
3435
NULL_TRANSLATION_SPEC_APP_CLASS("Null TranslationSpec App Class"),
3536
NULL_TRANSLATION_SPEC_INPUT_CLASS("Null TranslationSpec Input Class"),
36-
DUPLICATE_TRANSLATION_SPEC("Duplicate TranslationSpec"),
3737
UNKNOWN_TRANSLATION_SPEC("No translation spec was provided for the given class"),
3838
UNITIALIZED_TRANSLATION_SPEC("TranslationSpec not initialized"),
39-
UNKNOWN_OBJECT("Object is not Translatable by this TranslationSpec");
39+
UNINITIALIZED_TRANSLATORS(
40+
"Translators were added to the builder but were not initialized. Make sure to call super.initTranslators() during your custom engine build method"),
41+
UNKNOWN_OBJECT("Object is not Translatable by this TranslationSpec"),
42+
UNKNWON_TRANSLATION_ENGINE_TYPE("Translation Engine Type was not set"),
43+
UNKNOWN_CLASSREF("No object has been read in with the specified classRef");
4044

4145
private final String description;
4246

0 commit comments

Comments
 (0)