DDS-GmbH / jocument

JVM based template engine for DOCX and XLSX.
MIT License
3 stars 1 forks source link

WIP: Custom placeholders #12

Closed AntonOellerer closed 4 years ago

AntonOellerer commented 4 years ago

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) can be 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 the corresponding class.\ The registry is passed to the resolver on first creation, and subsequently gets passed to the recursive instantiations.