Expanders

Expanders are a very important peice in the archictecture of CodeStencil. They form a repository of labels and the strings defined to replace those labels during code generation.

You can define as many labels as you want to use for string replacement.

 

Expanders consist mainly of:

  • Expansion Label - This is the label you insert in your stencil
  • Expansion String - Replacement string
  • Delimiter - Character to delimit multiple strings

 

System Expansion Labels

A series of  labels are installed by default when you create a stencil. These labels cannot be deleted. However, their expansion strings can be updated. These are:

  1. NAMESPACE
  2. ORGANIZATION_LABEL
  3. ORGANIZATION_NAME
  4. PROJECT_NAME
  5. OUTPUT_FOLDER
  6. DEFAULT_LOCATION
  7. LOG_FILE

 

Here is a quick example of using Expanders:

a) We want to Expand a label called "NameSpace". This will expand into "ZeraSystems.CodeStencil".

 

b) Drag a label from the Expanders Grid and drop into the Code Editor. Note that the Expansion Label is automatically enclosed with "[%%]

 

c) Generate the code to see the string replacement in the generated file. 

 

Code Nanites are also used the same way. The only difference is that during code generation, the actual code (See Code Nanite Development) is called and executed. This code can be anything from generating more complicated strings or even uploading a file to ftp.

 

 

About CodeStencil

CodeStencil is Published and Marketed by Zera Systems Inc.





© 2018-2019 CodeStencil - Zera Systems Inc. All Rights Reserved.

No items in cart