Scala Compiler2.13.9 < Back


# Packages

-  package root

  The Scala compiler and reflection APIs.

  The Scala compiler and reflection APIs.

  Definition Classes
    root
-  package scala
  Definition Classes
    root
-  package tools
  Definition Classes
    scala
-  package nsc
  Definition Classes
    tools
-  package interactive
  Definition Classes
    nsc
-  package tests
  Definition Classes
    interactive
- CancelException
- CommentPreservingTypers
- CompilerControl
- CondPickler
- ContextTrees
- FreshRunReq
- Global
- InteractiveAnalyzer
- InteractiveReporter
- Lexer
- LogReplay
- Logger
- Main
- MissingResponse
- NoSuchUnitError
- NullLogger
- Pickler
- Picklers
- PresentationCompilerThread
- PrettyWriter
- Problem
- REPL
- RangePositions
- Replayer
- Response
- RichCompilationUnits
- ShutdownReq

c

scala.tools.nsc.interactive

# Pickler

###
Companion object Pickler

#### 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

Linear Supertypes
AnyRef, Any
Known Subclasses
CondPickler
Type Hierarchy

Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. Pickler
2. AnyRef
3. Any

Implicitly

1. by TildeDecorator
2. by any2stringadd
3. by StringFormat
4. by Ensuring
5. by ArrowAssoc

1. Hide All
2. Show All

Visibility

1. Public
2. Protected

### Instance Constructors

1.  new Pickler()

### Abstract Value Members

1.  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

2.  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 of `Pickler`, an `UnpickleFailure` value otherwise.

   Exceptions thrown

     `Lexer.MalformedInput` if input is invalid, or if an `Unpickle`

### Concrete Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##: Int
   Definition Classes
     AnyRef → Any
3.  def +(other: String): String
   Implicit
     This member is added by an implicit conversion from Pickler[T] toany2stringadd[Pickler[T]] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd
4.  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
     @inline()
5.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
6.  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.

7.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
8.  def clone(): AnyRef
   Attributes
     protected[lang]
   Definition Classes
     AnyRef
   Annotations
     @throws(classOf[java.lang.CloneNotSupportedException]) @native()
9.  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.

10.  def ensuring(cond: (Pickler[T]) => Boolean, msg: => Any): Pickler[T]
    Implicit
      This member is added by an implicit conversion from Pickler[T] toEnsuring[Pickler[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
11.  def ensuring(cond: (Pickler[T]) => Boolean): Pickler[T]
    Implicit
      This member is added by an implicit conversion from Pickler[T] toEnsuring[Pickler[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
12.  def ensuring(cond: Boolean, msg: => Any): Pickler[T]
    Implicit
      This member is added by an implicit conversion from Pickler[T] toEnsuring[Pickler[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
13.  def ensuring(cond: Boolean): Pickler[T]
    Implicit
      This member is added by an implicit conversion from Pickler[T] toEnsuring[Pickler[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
14.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
15.  def equals(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef → Any
16.  def finalize(): Unit
    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.Throwable])
17.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
18.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
19.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
20.  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.

21.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
22.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
23.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
24.  final def synchronized[T0](arg0: => T0): T0
    Definition Classes
      AnyRef
25.  def toString(): String
    Definition Classes
      AnyRef → Any
26.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
27.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
28.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException]) @native()
29.  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.

30.  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

1.  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

1.  def formatted(fmtstr: String): String
   Implicit
     This member is added by an implicit conversion from Pickler[T] toStringFormat[Pickler[T]] performed by method StringFormat in scala.Predef.
   Definition Classes
     StringFormat
   Annotations
     @deprecated @inline()
   Deprecated

     (Since version 2.12.16) Use `formatString.format(value)` instead of `value.formatted(formatString)`, or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.

2.  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.

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion TildeDecorator fromPickler[T] to TildeDecorator[Pickler[T]]

### Inherited by implicit conversion any2stringadd fromPickler[T] to any2stringadd[Pickler[T]]

### Inherited by implicit conversion StringFormat fromPickler[T] to StringFormat[Pickler[T]]

### Inherited by implicit conversion Ensuring fromPickler[T] to Ensuring[Pickler[T]]

### Inherited by implicit conversion ArrowAssoc fromPickler[T] to ArrowAssoc[Pickler[T]]

### Ungrouped