NullVisitor

object NullVisitor extends NoOpVisitor[Null]

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

class NoOpVisitor[Null]
trait Visitor[Any, Null]
trait AutoCloseable
class Object
trait Matchable
class Any

Value members

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
def map[Z](f: Null => Z): Visitor[Any, Z]
Inherited from
Visitor
def mapNulls[Z](f: Null => Z): Visitor[Any, Z]
Inherited from
Visitor
def visitArray(length: Int): ArrVisitor[Any, Null]
Inherited from
NoOpVisitor
def visitBinary(bytes: Array[Byte], offset: Int, len: Int): Null
Inherited from
NoOpVisitor
def visitChar(c: Char): Null
Inherited from
NoOpVisitor
def visitExt(tag: Byte, bytes: Array[Byte], offset: Int, len: Int): Null
Inherited from
NoOpVisitor
def visitFalse(): Null
Inherited from
NoOpVisitor
def visitFloat32(d: Float): Null
Inherited from
NoOpVisitor
def visitFloat64(d: Double): Null
Inherited from
NoOpVisitor
def visitFloat64String(s: String): Null
Inherited from
NoOpVisitor
def visitFloat64StringParts(cs: CharSequence, decIndex: Int, expIndex: Int): Null
Inherited from
NoOpVisitor
def visitInt32(i: Int): Null
Inherited from
NoOpVisitor
def visitInt64(l: Long): Null
Inherited from
NoOpVisitor
def visitNull(): Null
Inherited from
NoOpVisitor
def visitObject(length: Int): ObjVisitor[Any, Null]
Inherited from
NoOpVisitor
def visitString(cs: CharSequence): Null
Inherited from
NoOpVisitor
def visitTimestamp(instant: Instant): Null
Inherited from
NoOpVisitor
def visitTrue(): Null
Inherited from
NoOpVisitor
def visitUInt64(ul: Long): Null
Inherited from
NoOpVisitor