abstract class Pickler[T] extends AnyRef
An abstract class for writing and reading Scala objects to and from a legible representation. The representation follows the following grammar:
Pickled = `true` | `false` | `null` | NumericLit | StringLit | Labelled | Pickled `,` Pickled Labelled = StringLit `(` Pickled? `)`
All ...Lit classes are as in JSON. @see scala.tools.nsc.io.Lexer
Subclasses of Pickler
each can write and read individual classes
of values.
- T
the type of values handled by this pickler. These Picklers build on the work of Andrew Kennedy. They are most closely inspired by Iulian Dragos' picklers for Scala to XML. See: https://code.google.com/p/gdata-scala-client/wiki/DevelopersGuide
- Source
- Pickler.scala
- Alphabetic
- By Inheritance
- Pickler
- AnyRef
- Any
- by TildeDecorator
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Pickler()
Abstract Value Members
- abstract def pickle(wr: Writer, x: T): Unit
Writes value in pickled form
Writes value in pickled form
- wr
the writer to which pickled form is written
- x
the value to write
- abstract def unpickle(rd: Lexer): Unpickled[T]
Reads value from pickled form.
Reads value from pickled form.
- rd
the lexer from which lexemes are read
- returns
An
UnpickleSuccess
value if the current input corresponds to the kind of value that is unpickled by the current subclass ofPickler
, anUnpickleFailure
value otherwise.
- Exceptions thrown
Lexer.MalformedInput
if input is invalid, or if anUnpickle
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Pickler[T], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def asClass[U <: T](c: Class[U]): CondPickler[T]
A conditional pickler handling values of some Scala class.
A conditional pickler handling values of some Scala class. It adds the class name as a label to the representation of the current pickler and
- c
the class of values handled by this pickler.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def cond(p: (Any) => Boolean): CondPickler[T]
A conditional pickler obtained from the current pickler.
A conditional pickler obtained from the current pickler.
- p
the condition to test to find out whether pickler can handle some Scala value.
- def ensuring(cond: (Pickler[T]) => Boolean, msg: => Any): Pickler[T]
- def ensuring(cond: (Pickler[T]) => Boolean): Pickler[T]
- def ensuring(cond: Boolean, msg: => Any): Pickler[T]
- def ensuring(cond: Boolean): Pickler[T]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def labelled(label: String): Pickler[T]
A pickler that adds a label to the current pickler, using the representation
label ( <current pickler> )
A pickler that adds a label to the current pickler, using the representation
label ( <current pickler> )
- label
the string to be added as a label.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def wrapped[U](in: (T) => U)(out: (U) => T): Pickler[U]
A pickler obtained from the current pickler by a pair of transformer functions
A pickler obtained from the current pickler by a pair of transformer functions
- in
the function that maps values handled by the current pickler to values handled by the wrapped pickler.
- out
the function that maps values handled by the wrapped pickler to values handled by the current pickler.
- def ~[U](that: => Pickler[U]): Pickler[~[T, U]]
A pickler representing a
~
-pair of values as two consecutive pickled strings, separated by a comma.A pickler representing a
~
-pair of values as two consecutive pickled strings, separated by a comma.- that
the second pickler which together with the current pickler makes up the pair
this ~ that
to be pickled.
Shadowed Implicit Value Members
- def ~[T](y: T): ~[Pickler[T], T]
Infix method that forms a
~
-pair.Infix method that forms a
~
-pair.- Implicit
- This member is added by an implicit conversion from Pickler[T] toTildeDecorator[Pickler[T]] performed by method TildeDecorator in scala.tools.nsc.interactive.Pickler.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pickler: TildeDecorator[Pickler[T]]).~(y)
- Definition Classes
- TildeDecorator
Deprecated Value Members
- def →[B](y: B): (Pickler[T], B)
- Implicit
- This member is added by an implicit conversion from Pickler[T] toArrowAssoc[Pickler[T]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
The Scala compiler and reflection APIs.