Package

com.rallyhealth.weepickle.v1

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

  1. class Abort extends Exception

    Permalink

    Throw this inside a Visitor's handler functions to fail the processing of JSON.

    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.

  2. trait Annotator extends AnyRef

    Permalink
  3. trait ArrVisitor[-T, +J] extends ObjArrVisitor[T, J]

    Permalink

    Visits the elements of a json array.

  4. class CallbackVisitor[T, J] extends Delegate[T, J]

    Permalink

    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.

  5. trait FromInput extends AnyRef

    Permalink

    Input data, ready to push through a Visitor.

  6. trait JsVisitor[-T, +J] extends Visitor[T, J]

    Permalink

    A Visitor specialized to work with JSON types.

    A Visitor specialized to work with JSON types. Forwards the not-JSON-related methods to their JSON equivalents.

  7. class NoOpVisitor[J] extends Visitor[Any, J]

    Permalink
  8. sealed trait ObjArrVisitor[-T, +J] extends AnyRef

    Permalink

    Base class for visiting elements of json arrays and objects.

    Base class for visiting elements of json arrays and objects.

    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.

    J

    output result of visiting elements (e.g. a json AST or side-effecting writer)

  9. trait ObjVisitor[-T, +J] extends ObjArrVisitor[T, J]

    Permalink

    Visits the elements of a json object.

  10. trait SimpleVisitor[-T, +J] extends Visitor[T, J]

    Permalink

    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.

  11. class TransformException extends Exception

    Permalink

    Enriches an exception with parser-level information.

    Enriches an exception with parser-level information. This could be a problem with either the parsing or with the Visitor consuming the data.

  12. trait Types extends AnyRef

    Permalink

    Basic functionality to be able to read and write objects.

    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.

  13. trait Visitor[-T, +J] extends AutoCloseable

    Permalink

    Standard set of hooks weepickle uses to traverse over a structured data.

    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

    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 as J for visitors that return things, or else Any by visitors that do their work by side-effecting instead of returning J.

    J

    the result of visiting elements (e.g. a json AST or side-effecting writer)

    See also

    http://www.lihaoyi.com/post/ZeroOverheadTreeProcessingwiththeVisitorPattern.html

Value Members

  1. object JsonPointerVisitor

    Permalink

    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

    https://tools.ietf.org/html/rfc6901

  2. object NoOpVisitor extends NoOpVisitor[Unit]

    Permalink

    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.

  3. object NullVisitor extends NoOpVisitor[Null]

    Permalink

    Visitor returning null for all instances.

    Visitor returning null for all instances. Useful in combination with side-effecting visitors, since null is a valid subtype of AnyRef.

  4. object Platform

    Permalink
  5. object StringVisitor extends SimpleVisitor[Nothing, Any]

    Permalink
  6. object Util

    Permalink
  7. object Visitor

    Permalink

Ungrouped