Expander Guides
The ExpanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. Developer Guides offer a fairly sequential list of guides to help you create your first expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. / expansion resourceExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion.. These guides start from set up, over template creation, testing, to advanced tutorials.
Setup
Prerequisites
Creating a New Expander
When you have the latest version of the nsx-support plugin, you will be able to create new expanders using IntelliJ:
Defining the Artifact Path
For an expander, the artifact path and name define where the generated artifact will be located and how it will be named.
Making the Expander Conditional
Not all expanders and features should be applied to each element. Most expanders only run when some option is defined or a certain setting is used. For this, we can use the isApplicable condition.
Mapping the model to the template
The mapping file can contain a number of different mappings. This guide will show some mapping examples, to help you
Defining the Expanders template
Testing the base content of an expander
Adding Features for Crosscutting Concerns
Features are additions to the expanders which aim to add pieces of code to multiple expanders. A feature can then be enabled with some option or another condition to add logic to multiple artifacts at once.
Building models for Tests
You do not have to call the test model builder directly yourself, instead you
Customization Support
Custom Anchors
Harvest Expanders
In JEE Application projects, the base expanders generate /ext directories that are harvested.
Debugging Expanders
It may be difficult to track the mapping context while testing your expanders. We provide some tooling through the
Mapping Imports
Many generated artifacts have some form of import or include statements that need to be expanded.
Copy files from Classpath to Expansion
During the expansion process, it's a common requirement to include static assets or configuration files from your
Advanced
3 items