BoxLang 1.14.0 introduces two flavors of locally defined classes: Template Classes and Inner Classes. Template Classes can be declared inline inside .bxs scripts or .bxm templates without a separate file, support hoisting, inheritance, static members, and Java interop. Inner Classes are defined inside the body of another .bx class, compiled as sibling JVM classes accessible externally via $ separator syntax, and are especially useful for Java interface implementations like iterators and comparators. Both types support full inheritance, interfaces, and BoxLang's reflection API. The release also provides guidance on when to use template classes, inner classes, or traditional file-based classes.

5m read timeFrom foojay.io
Post cover image
Table of contents
The Two FlavorsTemplate ClassesHoistingMultiple Classes in One ScriptProperties, Constructors, and Static MembersInheritanceImports Are SharedTemplate Classes in .bxm FilesInner Classes
23.3K Impressions