ToJsonSubset

io.bullet.borer.Dom.Transformer.ToJsonSubset
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.

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

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

Members list

Value members

Concrete methods

Attributes

Definition Classes
override def transformFloat16(elem: Float16Elem): Element

Attributes

Definition Classes

Attributes

Definition Classes
override def transformSizedArray(elem: Sized): Element

Attributes

Definition Classes
override def transformSizedMap(elem: Sized): Element

Attributes

Definition Classes

Attributes

Definition Classes
override def transformUndefined(): Element

Attributes

Definition Classes

Inherited methods

def andThen[A](g: Element => A): T1 => A

Attributes

Inherited from:
Function1
def apply(elem: Element): Element

Attributes

Inherited from:
Transformer
def compose[A](g: A => Element): A => R

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
def transformArray(elements: Vector[Element]): Vector[Element]

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer
def transformMapMembers(members: Iterator[(Element, Element)]): Iterator[(Element, Element)]

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Attributes

Inherited from:
Transformer

Concrete fields