package json
- Alphabetic
- By Inheritance
- json
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- sealed trait IndexPredicate extends (Int) ⇒ Boolean
-
sealed
trait
JsonContext extends AnyRef
A JSON trace context, positioning the current location in the JSON value starting from the root.
- case class JsonException(msg: String, context: Option[JsonContext] = None, inner: Throwable = null) extends Exception with Product with Serializable
- class JsonMissingFieldException extends Exception
- case class JsonSelectorException(msg: String, idx: Int) extends Exception with Product with Serializable
- implicit final class JsonSelectorStringOps extends AnyVal
- sealed trait NamePredicate extends (String) ⇒ Boolean
-
sealed
trait
Selector extends AnyRef
Used to select tokens in a token stream.
-
class
SelectorParser[F[_]] extends AnyRef
Parses a filter string.
Parses a filter string. Syntax is as follows:
Selector ::= `.` | Sel Sel* Sel ::= `.` Name `!`? `?`? | `.` `[` String (`,` String)* `]` `!`? `?`? | `.` `[` Integer (`,` Integer)* `]` `?`? | `.` `[` Integer `:` Integer `]` `?`? | `.` `[` `]` `?`? Name ::= [a-zA-Z_][a-zA-Z0-9_]* String ::= <a json string> Integer ::= 0 | [1-9][0-9]*
- sealed abstract class Token extends AnyRef
Value Members
-
def
tokens[F[_], T](implicit F: RaiseThrowable[F], T: CharLikeChunks[F, T]): Pipe[F, T, Token]
Transforms a stream of characters into a stream of Json tokens.
Transforms a stream of characters into a stream of Json tokens. Emitted tokens are guaranteed to be valid up to that point. If the streams ends without failure, the sequence of tokens is sensured to represent a (potentially empty) sequence of valid Json documents.
- object IndexPredicate
- object JsonContext
- object NamePredicate
- object Selector
- object SelectorParser
- object Token
-
object
collector
Json Token stream collectors.
- object literals
-
object
render
Json Token stream pipes to render Json values.
-
object
wrap
A collection of pipes to wrap streams inside objects.
Deprecated Value Members
-
def
filter[F[_]](selector: Selector, wrap: Boolean = false)(implicit F: RaiseThrowable[F]): Pipe[F, Token, Token]
Filters the tokens according to the given selector sequence.
Filters the tokens according to the given selector sequence. if
wrap
is set totrue
then values selected by array selector are wrapped into an array, and values selected by object selector are wrapped into an object with original key maintained.- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.5.0) Use
fs2.data.json.jsonpath.filter
instead
-
def
tokenize[F[_], Json](implicit tokenizer: Tokenizer[Json]): Pipe[F, Json, Token]
Transforms a stream of Json values into a stream of Json tokens.
Transforms a stream of Json values into a stream of Json tokens.
This operation is the opposite of
values
.- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.3.0) Use
fs2.data.json.ast.tokenize
instead
-
def
transform[F[_], Json](selector: Selector, f: (Json) ⇒ Json)(implicit F: RaiseThrowable[F], builder: Builder[Json], tokenizer: Tokenizer[Json]): Pipe[F, Token, Token]
Transforms a stream of token into another one.
Transforms a stream of token into another one. The transformation function
f
is called on every selected value from upstream, and the resulting value replaces it. The rest of the stream is left unchanged.This operator locally creates Json AST values using the fs2.data.json.ast.Builder, and returns tokens as emitted by the fs2.data.json.ast.Tokenizer on the resulting value.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.3.0) Use
fs2.data.json.ast.transform
instead
-
def
transformF[F[_], Json](selector: Selector, f: (Json) ⇒ F[Json])(implicit F: RaiseThrowable[F], builder: Builder[Json], tokenizer: Tokenizer[Json]): Pipe[F, Token, Token]
Transforms a stream of token into another one.
Transforms a stream of token into another one. The transformation function
f
is called on every selected value from upstream, and the resulting value replaces it. The rest of the stream is left unchanged. The operation can fail, in case the returnedF
is failed at one step.This operator locally creates Json AST values using the fs2.data.json.ast.Builder, and returns tokens as emitted by the fs2.data.json.ast.Tokenizer on the resulting value.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.3.0) Use
fs2.data.json.ast.transformF
instead
-
def
transformOpt[F[_], Json](selector: Selector, f: (Json) ⇒ Option[Json])(implicit F: RaiseThrowable[F], builder: Builder[Json], tokenizer: Tokenizer[Json]): Pipe[F, Token, Token]
Transforms a stream of token into another one.
Transforms a stream of token into another one. The transformation function
f
is called on every selected value from upstream, and the resulting value replaces it. If the function returnsNone
, then the entire value is dropped (and the object key it is located at, if any). The rest of the stream is left unchanged.This operator locally creates Json AST values using the fs2.data.json.ast.Builder, and returns tokens as emitted by the fs2.data.json.ast.Tokenizer on the resulting value.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.3.0) Use
fs2.data.json.ast.transformOpt
instead
-
def
values[F[_], Json](implicit F: RaiseThrowable[F], builder: Builder[Json]): Pipe[F, Token, Json]
Transforms a stream of Json tokens into a stream of json values.
Transforms a stream of Json tokens into a stream of json values.
- Annotations
- @deprecated
- Deprecated
(Since version fs2-data 1.3.0) Use
fs2.data.json.ast.values
instead