Transformer

io.bullet.borer.Dom.Transformer
See theTransformer companion trait
object Transformer

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

trait ToJsonSubset extends Transformer

A Transformer that converts certain DOM elements of a given DOM structure that are not supported by the JSON renderer into alternative elements that can be represented in JSON.

A Transformer that converts certain DOM elements of a given DOM structure that are not supported by the JSON renderer into alternative elements that can be represented in JSON.

The elements that are not supported (and as such will still trigger errors during an attempted encoding to JSON) are:

  • Non-String Map Keys
  • Float.NaN, Float.PositiveInfinity, Float.NegativeInfinity
  • Double.NaN, Double.PositiveInfinity, Double.NegativeInfinity
  • Tags

This transformer can be used, for example, for converting a CBOR document to JSON by first parsing the CBOR encoding into a Dom.Element, then applying this transformer and then encoding the transformation result to JSON.

NOTE: Since there is no single, standard way of representing the CBOR-only DOM elements in JSON this transformer provides merely one of many possible such implementations. Override the respective methods in order to customize the logic!

Attributes

Supertypes
trait Transformer
trait Element => Element
class Object
trait Matchable
class Any