API / Apache FreeMarker Interview questions
Describe the built-ins available in FreeMarker?
A built-in is a function attached to a value with the ? operator, used to transform or query that value without a separate function-call syntax. They read left to right, close to the value they act on, which keeps expressions compact.
| Built-in | Purpose | Example |
| ?upper_case / ?lower_case | Change string case | name?upper_case |
| ?size | Length of a sequence or hash | items?size |
| ?string | Format a number, date, or boolean as text | price?string.currency |
| ?number | Parse a string into a number | input?number |
| ?trim | Remove leading/trailing whitespace | text?trim |
| ?join | Concatenate a sequence with a separator | tags?join(", ") |
Built-ins are grouped by the type they apply to (string, number, sequence, hash, date), and using one on the wrong type raises a template error, which helps catch mistakes early.
More Related questions...