FreshMarker Template Engine 1.0.0

I am proud to announce the release of FreshMarker 1.0.0! Having started as a small example for blog posts two years ago, FreshMarker has evolved into a robust and versatile framework designed to meet diverse templating needs.

FreshMarker Import Directive

FreshMarker is an embedded Java template engine that focusses on extensibility and simplicity. For this reason, every implementation of an extension is associated with weighing up its pros and cons. For a long time, the import directive therefore remained an unrealised feature.

XOR for FreshMarker

While reviewing the mutation tests for FreshMarker, I noticed an implementation gap in the logical expression. So if something needs to be changed, why not quickly add something new.

The Java String Template Processor

Java 22

With Java 22, string interpolation is fighting for its place in the Java ecosystem. What works in other languages and many frameworks should now also simplify the work of Java developers. Some wishes are fulfilled for the developers, others unfortunately not and some would never have been expressed. But more on that later.

FreshMarker – Custom String Types

Some additions to a framework are so trivial that they don’t really deserve their own article. On the other hand, as a developer, you may ask yourself why this addition has taken so long. For unknown data types, FreshMarker uses the interpretation of the class as a Java Bean by default. This is a good solution for many POJO, DTO and Entity classes, but in some cases the class should be used as a primitive FreshMarker type.

Rocinante – the class generator

In the first article on Project Rocinante, we discussed the processing of Protocol Buffer definition files with CongoCC. In this post we will create the first Java classes based on this definitions.

Rocinante – a poor mans protocol buffer

For a software developer who wants to improve his own skills, it is always helpful to try out new topics. A nice side effect of such small projects is that you always get new material for articles like this one.

CongoCC – der Congo Parser Generator

Java Bibliotheken

Zum Ende des Jahres lässt man all die vielen unerledigten Dinge Revue passieren und versucht noch das eine oder andere abzuarbeiten. Als letzter Beitrag des Jahres 2023 wird deshalb noch CongoCC vorgestellt. Der Congo Parser Generator ist der Nachfolger von JavaCC 21 und dem noch älteren JavaCC. Einige der hier vorgestellten Features existierten bereits in JavaCC 21, aber unter der Haube von CongoCC wurde in der Zwischenzeit eine Menge getan. Mittlerweile glänzt CongoCC mit Contextual Predicates, Context-sensitive Tokenization. Full 32-bit Unicode Support, Code Injection, Include Directive, Up-to-here Marker, Grammars for Java 19, Lua, Python and C#.

Trivial Pursuit – API MarkDown (2)

Fasst drei Jahre nach dem ersten Beitrag zum eigenen API MarktDown ergibt sich ein zweiter Beitrag zum Thema. Bei der Durchsicht der eigenen Projekte fiel auf, dass in dem Projekt rest-markdown-plugin noch immer FreeMarker als Template-Engine verwendet wurde. Die erste Ad-Hoc Umstellung der Template-Engine auf FreshMarker scheiterte jedoch kläglich.

Mehr Zeit mit FreshMarker

Einer der Gründe für die Entwicklung der FreshMarker Bibliothek, war die fehlende Unterstützung der Java Time API in FreeMarker. Daher existierte schon in der ersten Implementierung neben der Unterstützung für java.util.Date, java.sql.Date und java.sql.Time auch eine Unterstützung für java.time.LocalDateTime, java.time.LocalDate und java.time.LocalTime. In diesem Beitrag wird die Formatierung für alle temporalen Typen verbessert. Bislang beherrschte FreshMarker nur die Standarddarstellung und eine Computer Audience Darstellung.