Trait/Object

scala.pickling.spi

PicklerRegistry

Related Docs: object PicklerRegistry | package spi

Permalink

trait PicklerRegistry extends AnyRef

A registry for looking up (and possibly coding on the fly) picklers by tag.

All methods are thread-safe.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PicklerRegistry
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type Templates = (PicklerGen[Any], UnpicklerGen[Any])

    Permalink

Abstract Value Members

  1. abstract def genPickler(classLoader: ClassLoader, clazz: Class[_], tag: FastTypeTag[_])(implicit share: Share): Pickler[_]

    Permalink

    Looks up a Pickler for the given tag.

    Looks up a Pickler for the given tag. If none is found, then we attempt to generate one.

    classLoader

    The classloader to use when reflecting over the pickled class.

    clazz

    The clazz we need to pickle.

    tag

    The full tag of the type we're pickling, which may or may not include type parameters.

  2. abstract def genUnpickler(mirror: Mirror, tagKey: String)(implicit share: Share): Unpickler[_]

    Permalink

    Looks up the registered unpickler using the provided tagKey.

    Looks up the registered unpickler using the provided tagKey.

    If there are no registered picklers or pickler-generators, then we instead attempt to generate the pickler using the passed in information.

    TODO(jsuereth) - This should use classLoader just like genPickler. No reason to mix Java/Scala reflection.

    mirror

    The scala mirror (classloader/symbolloader) we use to generate the unpickler.

    tagKey

    The full tag of the type, which may or may not include type parameters.

  3. abstract def isLookupEnabled: Boolean

    Permalink

    Checks if lookup is enabled for this registry

  4. abstract def lookupExistingPickler(key: String): Option[Pickler[_]]

    Permalink

    Checks the existence of a pickler ignoring the registered generators.

  5. abstract def lookupExistingUnpickler(key: String): Option[Unpickler[_]]

    Permalink

    Checks the existence of an unpickler ignoring the registered generators.

  6. abstract def lookupPickler(key: String): Option[Pickler[_]]

    Permalink

    Looks for a pickler with the given FastTypeTag string.

    Looks for a pickler with the given FastTypeTag string.

    This will also check any registered generator functions.

  7. abstract def lookupUnpickler(key: String): Option[Unpickler[_]]

    Permalink

    Checks the existince of an unpickler.

    Checks the existince of an unpickler.

    This will also check any registered generator functions.

  8. abstract def registerPickler[T](key: String, p: Pickler[T]): Unit

    Permalink

    Registers a pickler with this registry for future use.

    Registers a pickler with this registry for future use.

    key

    The type key for the pickler. Note: In reflective scenarios this may not include type parameters. In those situations, the pickler should be able to handle arbitrary (existential) type parameters.

    p

    The pickler to register.

  9. abstract def registerPicklerGenerator[T](typeConstructorKey: String, generator: PicklerGen[T]): Unit

    Permalink

    Registers a function which can generate picklers for a given type constructor.

    Registers a function which can generate picklers for a given type constructor.

    typeConstructorKey

    The type constructor. e.g. "scala.List" for something that can make scala.List[A] picklers.

    generator

    A function which takes an applied type string (your type + arguments) and returns a pickler for this type. Note: it is possible for the type arguments to be an empty set. This is the case if we are trying to manually inspect an object at runtime to deterimine its type, and we do not know what the arguments are. You can treat this case as 'existential' arguments.

  10. abstract def registerPicklerUnpickler[T](key: String, p: Pickler[T] with Unpickler[T]): Unit

    Permalink

    Registers a pickler and unpickler for a type with this registry for future use.

    Registers a pickler and unpickler for a type with this registry for future use.

    key

    The type key for the pickler. Note: In reflective scenarios this may not include type parameters. In those situations, the pickler should be able to handle arbitrary (existential) type parameters.

    p

    The unpickler to register.

  11. abstract def registerPicklerUnpicklerGenerator[T](typeConstructorKey: String, generator: PicklerUnpicklerGen[T]): Unit

    Permalink

    Registers a function which can generate picklers for a given type constructor.

    Registers a function which can generate picklers for a given type constructor.

    typeConstructorKey

    The type constructor. e.g. "scala.List" for something that can make scala.List[A] picklers.

    generator

    A function which takes an applied type string (your type + arguments) and returns a pickler for this type.

  12. abstract def registerUnpickler[T](key: String, p: Unpickler[T]): Unit

    Permalink

    Registers an unpickler with this registry for future use.

    Registers an unpickler with this registry for future use.

    key

    The type key for the unpickler. Note: In reflective scenarios this may not include type parameters. In those situations, the unpickler should be able to handle arbitrary (existential) type parameters.

    p

    The unpickler to register.

  13. abstract def registerUnpicklerGenerator[T](typeConstructorKey: String, generator: UnpicklerGen[T]): Unit

    Permalink

    Registers a function which can generate picklers for a given type constructor.

    Registers a function which can generate picklers for a given type constructor.

    typeConstructorKey

    The type constructor. e.g. "scala.List" for something that can make scala.List[A] picklers.

    generator

    A function which takes an applied type string (your type + arguments) and returns a pickler for this type.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def registerPickler[T](p: Pickler[T]): Unit

    Permalink
  16. def registerPicklerUnpickler[T](p: Pickler[T] with Unpickler[T]): Unit

    Permalink
  17. final def registerTemplatesAtInit(ts: Vector[(String, Templates)]): Unit

    Permalink

    Register templates (also known as generators) that know how to pickle and unpickle types at runtime without using reflection.

  18. def registerUnpickler[T](p: Unpickler[T]): Unit

    Permalink
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped