(->transformer)
(->transformer {:keys [transformations]})
Creates a new Transformer
instance from given map of adjacencies and related configuration. By default uses
[[default-adjacencies]], but the map of adjacency lists to validation and transformation functions can be overridden.
; create new transformer with built-in defaults:
(def defaults-t (->transformer))
; create new transformer with custom transformation configuration:
(def custom-t (-> transformer {:transformations [:keyword :string] {:validator keyword?
:transformer name}
[:string :number] {:validator string?
:transformer parse-long}})
Creates a new [[Transformer]] instance from given map of adjacencies and related configuration. By default uses [[default-adjacencies]], but the map of adjacency lists to validation and transformation functions can be overridden. ```clojure ; create new transformer with built-in defaults: (def defaults-t (->transformer)) ; create new transformer with custom transformation configuration: (def custom-t (-> transformer {:transformations [:keyword :string] {:validator keyword? :transformer name} [:string :number] {:validator string? :transformer parse-long}}) ```
Collection of default type transformations.
See also [[transform]]
Collection of default type transformations. See also [[transform]]
Transformer defines an encapsulated relation between possible transformation steps represented as adjacency list, the digraph they form and user space API for working with the data.
Transformer defines an encapsulated relation between possible transformation steps represented as adjacency list, the digraph they form and user space API for working with the data.
(graph-dot this)
Render the contained graph out as DOT document. Returns the result as string.
Render the contained graph out as DOT document. Returns the result as string.
(transform this from to value)
Tries to transform given value
between given types. The type pair from
and to
does not have to be directly
known but must be resolvable into a transformation chain.
If path between the types is not found, special value ::unknown-path
is returned.
If value cannot be transformed with the resolved chain, special value ::invalid-value
is returned.
Tries to transform given `value` between given types. The type pair `from` and `to` does not have to be directly known but must be resolvable into a transformation chain. If path between the types is not found, special value `::unknown-path` is returned. If value cannot be transformed with the resolved chain, special value `::invalid-value` is returned.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close