I see why I dismissed this, its not prefixed with B4X and I assumed it only applies to B4A. It works, wow, great stuff.
https://www.b4x.com/android/forum/threads/custom-class-templates-in-b4a.90552/
Anyway
1. Create your B4J library as you would normally create it.
2. Create your skeleton class modules that you want to include it in your library that will be a templates
3. Rename the extension from
.bas to
.b4x_excluded and ensure the header content is removed on your class, this would be...
B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=6.51
@EndOfDesignText@
This should be for all the templates.
4. Open your library .jar file with 7 zip / any compressor and drag and drop the .b4x_excluded files there.
5. Open the xml file that came with your compiled library and for each template add a line just before the closing </root> element
<customClass>filenamewithoutextension:MashyClass, name:Mashy Nice Class</customClass>
Where MashyClass is the exact name of your file name without .b4x_excluded.
Ta!