Packages

trait SchemaVisitor extends AnyRef

This trait describes various types that a Daml package can contain. SchemaProcessor will use an implementation of this trait to feed types into the visitor. The visitor implementation should define SchemaVisitor.Type, which can be a Codec, or a Code-generator along with instructions how to process daml types. There are several use cases:

Codecs

To achieve the best performance, a codec should create a tree-like structure copying the structure of Daml types with each node processing corresponding daml type and delegating processing to the next node if it's a type container.

A codec should convert to and from DynamicValue instances. This allows to compose codecs from various protocols by combining them in com.digitalasset.transcode.Converter. For example, one code combine JsonCodec and GrpcValueCodec to get direct conversions from json to Ledger API proto values and vice versa. Or one can compose JsonCodec and ScalaCodec, etc.

Code generators

Code generators can produce code snippets at each handler and combine them into a file or a set of files that can be used as generated source in the target language.

It is advisable to also generate a codec along with DTOs (Data Transfer Object) to allow for direct interoperability with other existing protocols (Json or Protobuf).

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SchemaVisitor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract type Type

    Visitor handler type for various DAML schema cases.

Abstract Value Members

  1. abstract def bool: Type

    Boolean

  2. abstract def contractId(template: Type): Type

    Contract Id, parametrized with the processor for corresponding template

  3. abstract def date: Type

    Date

  4. abstract def enum(id: Identifier, cases: Seq[EnumConName]): Type

    ADT, Sum type - special case, where there are only named constructors without further payloads

  5. abstract def genMap(key: Type, value: Type): Type

    Map with keys and values of any type

  6. abstract def int64: Type

    8-byte Integer

  7. abstract def interface(name: Identifier): Type

    Interface.

    Interface. Used in code-gens. There is no representation of interface in Dynamic Value

  8. abstract def list(elem: Type): Type

    Sequence of elements

  9. abstract def numeric(scale: Int): Type

    Numeric with scale

  10. abstract def optional(elem: Type): Type

    Optional element

  11. abstract def party: Type

    Party

  12. abstract def record(id: Identifier, appliedArgs: => Seq[(TypeVarName, Type)], fields: => Seq[(FieldName, Type)]): Type

    ADT, Product type

  13. abstract def text: Type

    Text

  14. abstract def textMap(value: Type): Type

    Map with keys of String/Text type

  15. abstract def timestamp: Type

    Timestamp

  16. abstract def unit: Type

    Unit

  17. abstract def variable(name: TypeVarName, value: Type): Type

    Type Variable.

    Type Variable.

    Codecs might want to use value substitution, effectively replacing type variables with concrete types, while code generators might want to use type variable names.

  18. abstract def variant(id: Identifier, appliedArgs: => Seq[(TypeVarName, Type)], cases: => Seq[(VariantConName, Type)]): Type

    ADT, Sum type

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped