← All languages

wildling

Java library and CLI for pattern-based string generation. Zero third-party dependencies (JDK standard library only). Targets Java 11+.

Example

Install

From this repository:

cd java
./build.sh
./bin/wildling "Year 19##"

From a release tag:

git clone --branch v2.0.0 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling
./build.sh java

Registry: Maven Central (when published)

Produces dist/wildling.jar. Requires a JRE to run (java -jar), or Docker (the launcher falls back to the Temurin image if java is not on PATH).

As a library, add dist/wildling.jar to your classpath:

import wildling.Wildling;
import java.util.List;
import java.util.Map;

Wildling wildling = Wildling.create(List.of("Year 19##"), Map.of());
Object value = wildling.next();
while (!Boolean.FALSE.equals(value)) {
    System.out.println(value);
    value = wildling.next();
}

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker (eclipse-temurin): javac + jar, embeds help.txt

Project tests live in ../tests/ and are run with ../test.sh.