TaggedTo

trait TaggedTo[T] extends SimpleTo[T] with Tagged
Companion
object
trait Tagged
trait SimpleTo[T]
trait SimpleVisitor[Any, T]
trait To[T]
trait Visitor[Any, T]
trait AutoCloseable
class Object
trait Matchable
class Any
trait TaggedFromTo[T]
class Leaf[T]
class Node[T]
class Leaf[T]
class Node[T]

Value members

Abstract methods

def findTo(s: String): To[T]

Concrete methods

override
def expectedMsg: String
Definition Classes
override
def visitArray(length: Int): ArrVisitor[Any, T]
Definition Classes
override
def visitObject(length: Int): ObjVisitor[Any, T]
Definition Classes

Inherited methods

override
def close(): Unit

==Responsibility== Generally, whoever creates the visitor should be responsible for closing it, i.e. not intermediate transform(v: Visitor) methods themselves.

==Responsibility== Generally, whoever creates the visitor should be responsible for closing it, i.e. not intermediate transform(v: Visitor) methods themselves.

==Self Closing== Given that common usage is most often single-valued (e.g. "{}"), rather than multi-valued (e.g. "{} {} {}"), Visitors may self-close (e.g. visitor.map{v => Try(v.close); v)} after a single value to prevent resource leaks, but are encouraged to expose both forms (i.e. single/multiple), if supportable.

==Multiple close() calls/Idempotency== Visitors are encouraged to respond gracefully if close() is called multiple times. If an underlying resource would throw if already closed, this may mean adding a private var isClosed: Boolean field to prevent multiple calls.

Definition Classes
Visitor -> AutoCloseable
Inherited from
Visitor
override
def map[Z](f: T => Z): To[Z]
Definition Classes
Inherited from
To
override
def mapNulls[Z](f: T => Z): To[Z]
Definition Classes
Inherited from
To
def narrow[K <: T]: To[K]
Inherited from
To
def tagName: String

Name of the object key used to identify the subclass tag. Tos will fast path if this is the first field of the object. Otherwise, Tos will have to buffer the content and find the tag later. While naming, consider that some implementations (e.g. vpack) may sort object keys, so symbol prefixes work well for ensuring the tag is the first property.

Name of the object key used to identify the subclass tag. Tos will fast path if this is the first field of the object. Otherwise, Tos will have to buffer the content and find the tag later. While naming, consider that some implementations (e.g. vpack) may sort object keys, so symbol prefixes work well for ensuring the tag is the first property.

Inherited from
Tagged
def visitBinary(bytes: Array[Byte], offset: Int, len: Int): T
Inherited from
SimpleVisitor
def visitChar(c: Char): T
Inherited from
SimpleVisitor
def visitExt(tag: Byte, bytes: Array[Byte], offset: Int, len: Int): T
Inherited from
SimpleVisitor
def visitFalse(): T
Inherited from
SimpleVisitor
def visitFloat32(d: Float): T
Inherited from
SimpleVisitor
def visitFloat64(d: Double): T
Inherited from
SimpleVisitor
def visitFloat64String(s: String): T
Inherited from
SimpleVisitor
def visitFloat64StringParts(cs: CharSequence, decIndex: Int, expIndex: Int): T
Inherited from
SimpleVisitor
def visitInt32(i: Int): T
Inherited from
SimpleVisitor
def visitInt64(l: Long): T
Inherited from
SimpleVisitor
def visitNull(): T
Inherited from
SimpleVisitor
def visitString(cs: CharSequence): T
Inherited from
SimpleVisitor
def visitTimestamp(instant: Instant): T
Inherited from
SimpleVisitor
def visitTrue(): T
Inherited from
SimpleVisitor
def visitUInt64(ul: Long): T
Inherited from
SimpleVisitor