package lenses
- Alphabetic
- By Inheritance
- lenses
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait BasicRules extends AnyRef
- trait ExtraImplicits extends AnyRef
- case class GetOrThrow[B](e: Either[Throwable, B]) extends Product with Serializable
- type Id[T] = T
- trait Join[M1[_], M2[_], R[_]] extends AnyRef
This typeclass with its implicit instances decides how two containers should be joined.
This typeclass with its implicit instances decides how two containers should be joined.
Supported containers are
Id
for scalar valuesOption
for optional valuesSeq
for a vector of values
Those container types form an ordering from most specific to most abstract:
Id
contains always one valueOption
contains always zero or one valueSeq
can contain any number of values
The rule to determine what the result type of joining two container types is that the result is as generic as the more generic of both of the input types.
The implicit definitions in the companion object of join form evidence for this ordering.
- type JsPred = (JsValue) => Boolean
- trait JsonPathIntegration extends AnyRef
- trait Lens[M[_]] extends UpdateLens with ReadLens[M]
A Lens combines read and update functions of UpdateLens and ReadLens into combinable chunks.
A Lens combines read and update functions of UpdateLens and ReadLens into combinable chunks.
A lens can either operate on a scalar value, or on an optional value, or on a sequence value. This is denoted by the
M[_]
type constructor. - abstract class LensImpl[M[_]] extends Lens[M]
This implements most of the methods of
Lens
.This implements most of the methods of
Lens
. Implementors of a new type of lens must implementretr
for the read side of the lens andupdated
for the update side of the lens. - type Operation = (SafeJsValue) => SafeJsValue
- trait Operations extends OptionalFieldOperations
Defines a set of operations to update Json values.
- trait Ops[M[_]] extends AnyRef
A trait to define common operations for different container types.
A trait to define common operations for different container types. There's some bias towards
Seq
because container types have to support conversions towards and fromSeq
.This could probably made more general but the methods defined here comprise exactly the set of operations needed to allow combining different kinds of lenses.
- type OptLens = Lens[Option]
- trait OptionLenses extends AnyRef
- trait OptionalFieldOperations extends AnyRef
- trait ReadLens[M[_]] extends AnyRef
The read lens can extract child values out of a JsValue hierarchy.
The read lens can extract child values out of a JsValue hierarchy. A read lens is parameterized with a type constructor. This allows to extracts not only scalar values but also sequences or optional values.
- trait Reader[T] extends AnyRef
- type SafeJsValue = Either[Exception, JsValue]
- type ScalarLens = Lens[Id]
- trait ScalarLenses extends AnyRef
- type SeqLens = Lens[Seq]
- trait SeqLenses extends AnyRef
- trait Update extends (JsValue) => JsValue
- trait UpdateLens extends AnyRef
The UpdateLens is the central interface for updating a child element somewhere deep down a hierarchy of a JsValue.
- case class ValidateOption[T](option: Option[T]) extends Product with Serializable
- type Validated[T] = Either[Exception, T]
Value Members
- def ???: Nothing
- implicit def orThrow[B](e: Either[Throwable, B]): GetOrThrow[B]
- def outOfBounds(message: String): Left[IndexOutOfBoundsException, Nothing]
- implicit def rightBiasEither[A, B](e: Either[A, B]): RightProjection[A, B]
- def safe[T](body: => T): Validated[T]
- def unexpected(message: String): Left[RuntimeException, Nothing]
- implicit def validateOption[T](o: Option[T]): ValidateOption[T]
- object ExtraImplicits extends ExtraImplicits
- object Join
- object JsonLenses extends ScalarLenses with OptionLenses with SeqLenses with Operations with JsonPathIntegration with ExtraImplicits
An aggregate option to import all of the functionality of JsonLenses with one import.
- object JsonPath
The AST for a json-path.
The AST for a json-path. Basically follows the specification at http://goessner.net/articles/JsonPath/
- object JsonPathParser extends Parser with BasicRules
A parser for json-path expression as specified here: http://goessner.net/articles/JsonPath/
- object Operations extends Operations with ExtraImplicits
- object Ops
- object OptionLenses extends OptionLenses
- object Reader
- object ScalarLenses extends ScalarLenses
- object SeqLenses extends SeqLenses