Skip to content

Commit

Permalink
Update README (#135)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Edgar <[email protected]>
  • Loading branch information
MikeEdgar authored Feb 15, 2024
1 parent d2e4446 commit a1d18c8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ try (JsonParser parser = Yaml.createParser(reader)) {
```

module-info.java:

```java
module your.module {

// ...
requires io.xlate.yamljson;
// ...

// One of the following (if not using the --add-modules java option)
requires org.snakeyaml.engine.v2;
requires org.yaml.snakeyaml;

}
```

Expand Down Expand Up @@ -46,9 +52,13 @@ Pick one of the two listed by choosing a dependency.
```

## Supported YAML Services
Placing one of the two supported YAML libraries on the class/module path will enable that library within `yaml-json`. Note, when using JPMS modules, you must also add the module via the `java` command.
Placing one of the two supported YAML libraries on the class/module path will enable that library within `yaml-json`.
Note, when using JPMS modules, you must also add the module via the `java` command or your application's `module-info.java` file.

If *both* libraries are present in your application, you can specify which to use by creating one of the factories in the `io.xlate.yamljson.Yaml` class and passing a configuration property with key `io.xlate.yamljson.Yaml.Settings.YAML_VERSION` and one of the values `io.xlate.yamljson.Yaml.Versions.V1_1` or `io.xlate.yamljson.Yaml.Versions.V1_2`. Note, the values specified here are the names of constants, NOT the values themselves.
If *both* libraries are present in your application, you can specify which to use by creating one of the factories in the
`io.xlate.yamljson.Yaml` class and passing a configuration property with key `io.xlate.yamljson.Yaml.Settings.YAML_VERSION`
and one of the values `io.xlate.yamljson.Yaml.Versions.V1_1` or `io.xlate.yamljson.Yaml.Versions.V1_2`. Note, the values
specified here are the names of constants, NOT the values themselves.

### SnakeYaml (YAML 1.1):
```xml
Expand All @@ -58,7 +68,7 @@ If *both* libraries are present in your application, you can specify which to us
<version>${version.snakeyaml}</version>
</dependency>
```
Add to `java` command: `--add-modules=org.yaml.snakeyaml`
*Note*: If using JPMS, also include `org.yaml.snakeyaml` as required in `module-info` or add to `java` command: `--add-modules=org.yaml.snakeyaml`

### SnakeYaml Engine (YAML 1.2):
```xml
Expand All @@ -68,5 +78,5 @@ If *both* libraries are present in your application, you can specify which to us
<version>${version.snakeyaml-engine}</version>
</dependency>
```
Add to `java` command: `--add-modules=org.snakeyaml.engine.v2`
*Note*: If using JPMS, also include `org.snakeyaml.engine.v2` as required in `module-info` or add to `java` command: `--add-modules=org.snakeyaml.engine.v2`

0 comments on commit a1d18c8

Please sign in to comment.