Complete the README with explainations on the Java library.

This commit is contained in:
Feufochmar 2023-08-17 16:24:59 +02:00
parent c0e4af560a
commit c20806b0c5
1 changed files with 17 additions and 0 deletions

View File

@ -20,3 +20,20 @@ It's up to the application using the format to define them, their meaning and th
The commands and parameter names are limited to the latin lowercase alphabetic characters.
The characters `@`, `[`, `]`, `{` and `}` must be escaped with a prefixing `@` if they are not part of a command.
# Compiling the Java library
The Java library for manipulating Scribbly text can be compiled using maven.
It uses the standard commands (clean, package, install).
```
mvn clean package
mvn install
```
# The Java API
The classes are in the `fr.feufochmar.scribbly` namespace.
A Scribbly document is represented by the `ScribblyDocument` class, which contain a list of `ScribblyElement`.
A `Scribbly` element is either a `ScribblyCommand` (representing a command, its parameters, and the list of ScribblyElements on which it apply) or a `ScribblyText` (representing text outside commands).
A Scribbly document is processed using the visitor patter, using an instance of the `ScribblyVisitor` interface.
The `ScribblyDocumentParser` class can be used to build a `ScribblyDocument` from a file, input stream or reader.
The `ScribblyDocumentWriter` is an example of `ScribblyVisitor` implementation allowing to write a `ScribblyDocument` into an output stream or writer.