com.rallyhealth.weepickle.v1.core
Type members
Classlikes
Throw this inside a Visitor's handler functions to fail the processing of JSON. The Facade just needs to provide the error message, and it is up to the driver to ensure it is wrapped with relevant parser-level information.
Throw this inside a Visitor's handler functions to fail the processing of JSON. The Facade just needs to provide the error message, and it is up to the driver to ensure it is wrapped with relevant parser-level information.
Notifies the callback
of top-level results returned by the delegate visitor.
Notifies the callback
of top-level results returned by the delegate visitor.
Useful from extracting return values from visitors that are used in side-effecting positions.
Input data, ready to push through a Visitor.
Input data, ready to push through a Visitor.
Adds a JSON Pointer to exceptions thrown by the delegate Visitor.
Adds a JSON Pointer to exceptions thrown by the delegate Visitor.
JSON Pointer is standardized by RFC 6901 and commonly used by JSON Schema.
Useful for debugging failures. Adds ~10% overhead depending on the parser.
- See also
NoOpVisitor discards all JSON AST information.
NoOpVisitor discards all JSON AST information.
This is the simplest possible visitor. It could be useful for checking JSON for correctness (via parsing) without worrying about saving the data.
It will always return Unit on any successful parse, no matter the content.
- Companion
- class
Visitor returning null for all instances. Useful in combination with side-effecting visitors, since null is a valid subtype of AnyRef.
Visitor returning null for all instances. Useful in combination with side-effecting visitors, since null is a valid subtype of AnyRef.
Base class for visiting elements of json arrays and objects.
Base class for visiting elements of json arrays and objects.
- Type Params
- J
output result of visiting elements (e.g. a json AST or side-effecting writer)
- T
input result of visiting a child of this object or array. object or array builders will typically insert this value into their internal Map or Seq.
A visitor that throws an error for all the visit methods which it does not define, letting you only define the handlers you care about.
A visitor that throws an error for all the visit methods which it does not define, letting you only define the handlers you care about.
Enriches an exception with parser-level information. This could be a problem with either the parsing or with the Visitor consuming the data.
Enriches an exception with parser-level information. This could be a problem with either the parsing or with the Visitor consuming the data.
- Value Params
- col
column of text (if applicable) (1-indexed)
- line
line of text (if applicable) (1-indexed)
- shortMsg
free-text of what/where went wrong.
- token
textual representation of the json token (if applicable)
Basic functionality to be able to read and write objects. Kept as a trait so
other internal files can use it, while also mixing it into the com.rallyhealth.weepickle.v1
package to form the public API.
Basic functionality to be able to read and write objects. Kept as a trait so
other internal files can use it, while also mixing it into the com.rallyhealth.weepickle.v1
package to form the public API.
Standard set of hooks weepickle uses to traverse over a structured data. A superset of the JSON, MessagePack, and Scala object hierarchies, since it needs to support efficiently processing all of them.
Standard set of hooks weepickle uses to traverse over a structured data. A superset of the JSON, MessagePack, and Scala object hierarchies, since it needs to support efficiently processing all of them.
Note that some parameters are un-set (-1) when not available; e.g.
visitArray
's length
is not set when parsing JSON input (since it cannot
be known up front) and the various index
parameters are not set when
traversing Scala object hierarchies.
When expecting to deal with a subset of the methods; it is common to
forward the ones you don't care about to the ones you do; e.g. JSON visitors
would forward all visitFloat32
/visitInt
/etc. methods to visitFloat64
- Type Params
- J
the result of visiting elements (e.g. a json AST or side-effecting writer)
- T
the result of ObjArrVisitor.subVisitor which is passed back into a ArrVisitor and ObjVisitor via ObjArrVisitor.visitValue. For example, this might be a weejson.Str that gets passed into an ObjVisitor that's building up a weejson.Obj to be returned on ObjVisitor.visitEnd. Often
T
will be the same type asJ
for visitors that return things, or else Any by visitors that do their work by side-effecting instead of returningJ
.
- See also
- Companion
- object