filip26 / hydrogen-yaml

An intelligent YAML generator

Home Page:https://apicatalog.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java API for YAML Processing

Java CI with Maven Language grade: Java Maintainability Rating Coverage Maven Central License

Hydrogen YAML is the simplest human-readable data-serialization language inspired by StrictYAML. Some YAML features are not intentionally supported.

Hydrogen Features

  • Fully decoupled data model from a representation
  • Implicit serialization style
    • an intelligent YAML generator
    • customizable print style
  • Explicit typing
    • target class adapters

Unsupported YAML Features

  • Implicit typing
  • Duplicate keys
  • Explicit tags
  • Node anchors and refs
  • Flow style (except scalars and simple sequences)
  • Complex mapping keys
  • Directives

See What YAML features does StrictYAML remove? for more details.

Presence of a removed feature raises an exception during parsing.

Usage

Maven

<dependency>
    <groupId>com.apicatalog</groupId>
    <artifactId>hydrogen-yaml</artifactId>
    <version>0.2.1</version>
</dependency>

Gradle

compile group: 'com.apicatalog', name: 'hydrogen-yaml', version: '0.2.1'

Examples

YamlNode node = Yaml.createMappingBuilder()
                    .add("key", "value")
                    .add("sequence", Yaml.createSequenceBuilder()
                                         .add("item")
                    ).build();
     
Yaml.createWriter(OutputStream|Writer).write(YamlNode);

Roadmap

  • 0.1 Document API
  • 0.2 Writer API
  • 0.3 Parser API
  • 0.5 Flow Sequence of Scalars
  • 0.6 Multi-documents
  • 0.8 Beans Binding

About

An intelligent YAML generator

https://apicatalog.com

License:Apache License 2.0


Languages

Language:Java 100.0%