Package io.helidon.metadata.hson


package io.helidon.metadata.hson
Tiny HSON parser and writer. This is intended for annotation processors, code generators, and readers of the generated files, such as Config Metadata, Service Registry etc.

To write HSON (compatible with JSON), start with either of the following types:

To read HSON, start with Hson.parse(java.io.InputStream).

Supported features, non-features:

  • Only UTF-8 is supported
  • Arrays
  • Structs (Same as JsonObject from JSON-P in semantics)
  • Nesting of structs and arrays
  • String, BigDecimal, boolean, null
  • No pretty print (always writes as small as possible)
  • Keeps order of insertion on write
  • Keeps order of original HSON on read
  • Can read unicode escaped characters (\ u0000), but not write them
  • Maximal value size is 64000 bytes
  • Maximal HSON size is unlimited - NEVER USE WITH OVER-THE-NETWORK PROVIDED HSON
Should you use this library? No, unless:
  • You are developing writing or parsing of metadata in Helidon codegen or runtime for Helidon features, the metadata must be produced by Helidon as well (NEVER USE ON OVER-THE-NETWORK PROVIDED HSON)
  • You are a brave user who wants to do something similar in their library
NOTE: HSON is compatible with JSON, with the limitations mentioned in the list above. This module is not Helidon JSON solution - please use one of the supported JSON libraries, such as JSON-P, JSON-B, or Jackson.

WARNING: The HSON value is always fully read into memory