object Factory
Entry point for constructing containers from JSON and centralized registry of container types.
Containers filled in Python or on remote sites are serialized as JSON that the Factory
object can reconstruct. Reconstructed containers are fixed (immutable, cannot aggregate), but can be merged with the +
operator. (Click on the "o" in a circle in the upper-left to see the Factory
trait's documentation, which explains the difference.)
To do this, the Factory
object must dispatch JSON to the appropriate container for interpretation. It therefore manages a global registry of container types (concrete instances of the Factory
trait). General users are not expected to add to this registry, but they could if they want to.
- Alphabetic
- By Inheritance
- Factory
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(name: String): Factory
Get a registered container by its name.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromJson(json: Json): Container[_] with NoAggregation
User's entry point for reconstructing a container from a JSON object.
User's entry point for reconstructing a container from a JSON object.
The container's type is not known at compile-time, so it must be cast (with the container's
as
method) or pattern-matched (with the correspondingFactory
). - def fromJsonFile(file: File): Container[_] with NoAggregation
User's entry point for reading a container as JSON from a UTF-8 encoded file.
User's entry point for reading a container as JSON from a UTF-8 encoded file.
The container's type is not known at compile-time, so it must be cast (with the container's
as
method) or pattern-matched (with the correspondingFactory
). - def fromJsonFile(fileName: String): Container[_] with NoAggregation
User's entry point for reading a container as JSON from a UTF-8 encoded file.
User's entry point for reading a container as JSON from a UTF-8 encoded file.
The container's type is not known at compile-time, so it must be cast (with the container's
as
method) or pattern-matched (with the correspondingFactory
). - def fromJsonStream(inputStream: InputStream): Container[_] with NoAggregation
User's entry point for reading a container as JSON from a UTF-8 encoded file.
User's entry point for reading a container as JSON from a UTF-8 encoded file.
Note: fully consumes the
inputStream
.The container's type is not known at compile-time, so it must be cast (with the container's
as
method) or pattern-matched (with the correspondingFactory
). - def fromJsonString(str: String): Container[_] with NoAggregation
User's entry point for reconstructing a container from JSON text.
User's entry point for reconstructing a container from JSON text.
The container's type is not known at compile-time, so it must be cast (with the container's
as
method) or pattern-matched (with the correspondingFactory
). - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def register(factory: Factory): Unit
Add a new
Factory
to the registry, introducing a new container type on the fly.Add a new
Factory
to the registry, introducing a new container type on the fly. General users usually wouldn't do this, but they could. This method is used internally to define the standard container types. - def registered: ListMap[String, Factory]
Get a list of registered containers as a
Map
from factory name toFactory
object. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)