Intuitive DSL for Java

Version 2.1.0 · examples/README.md

Git clone
git clone https://www.dbalabs.ch/git/intuitive-dsl-java.git

README.md

Intuitive DSL - Examples

This directory contains a collection of practical examples demonstrating the capabilities of the Intuitive DSL engine for Java.

Intuitive DSL allows you to easily parse, validate, and bind custom natural-language or enterprise commands directly to your Java objects.

Main Engine Repository: Intuitive DSL

Prerequisites

  • JDK 17 or higher
  • Maven 3.6+

Project Structure

This directory contains 5 independent Maven example projects. Each example can be opened and run on its own.

It is recommended to explore them in the following order:

  • 01-quickstart: The absolute basics. Learn how to map a simple string command to a Java class using @DslCommand and @Bind.
  • 02-quoted-values-and-tokenization: Understand the engine's lexer. Learn how to handle spaces, punctuation, and SQL-style single quotes.
  • 03-bindings: Discover the power of the TypeConverter and the after attribute to automatically convert types (UUIDs, Enums), resolve structural flags, and disambiguate parameters.
  • 04-macros: Learn how to use dynamic placeholders (${macro_name}) to inject runtime vocabularies and external registries into your grammar.
  • 05-enterprise-command-grammar: The culmination of all features. A complex, real-world database provisioning grammar combining alternatives, optional blocks, macros, and flags.

How to build and run

Each example is an independent Maven project.

To run a specific example, navigate to its directory and use the Maven exec plugin. For example:

cd 01-quickstart  
mvn clean compile exec:java

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.