GithubHelp home page GithubHelp logo

valery1707 / jackson-dataformat-hocon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jclawson/jackson-dataformat-hocon

0.0 3.0 0.0 54 KB

Jackson parser format for parsing HOCON

License: Apache License 2.0

Java 100.00%

jackson-dataformat-hocon's Introduction

HOCON Jackson data format

Implementation of a Jackson parser for parsing the HOCON data format.

What the heck is HOCON?

HOCON stands for Human-Optimized Config Object Notation and is made by Typesafe.

In short, HOCON combines YAML, JSON, and Properties files into a single format. On most cases, YAML, JSON, and Properties formats are all valid HOCON--- and it can be mixed and matched at will. Check out the HOCON docs for more detail on the format.

Why this project?

This project lets you use HOCON to configure any application that uses Jackson to parse its configuration files.

How to Use

Add the following fragment to your project pom to include HOCON data format:

  <dependency>
    <groupId>org.honton.chas.hocon</groupId>
    <artifactId>jackson-dataformat-hocon</artifactId>
    <version>1.1.1</version>
  </dependency>

Create the Jackson ObjectMapper with the following constructor:

  ObjectMapper mapper = new ObjectMapper(new HoconFactory());

Some Caveats

There is support for HOCON include statements if the URL or File version of ObjectMapper is used. (Unfortunately, the Jackson InputDecorator will be ignored).

  Configuration c = mapper.readValue(new URL("http://example.com/path/test.conf"), Configuration.class);

or

  Configuration c = mapper.readValue(new File(filepath), Configuration.class);

There is support for Jackson InputDecorator if the InputStream or Reader version of ObjectMapper is used. (Unfortunately, the HOCON statements include will be ignored).

  Configuration c = mapper.readValue(new FileInputStream("http://example.com/path/test.conf"), Configuration.class);

or

  Configuration c = mapper.readValue(new InputStreamReader(is), Configuration.class);

Build Status Maven Central Javadoc

jackson-dataformat-hocon's People

Contributors

jclawson avatar tburch avatar chonton-elementum avatar chonton avatar friso avatar valery1707 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.