Package com.io7m.cedarbridge.codegen.java.internal.serializer_instantiation

# Class CBCGSerializerInstantiations

java.lang.Object
com.io7m.cedarbridge.codegen.java.internal.serializer_instantiation.CBCGSerializerInstantiations

public final class CBCGSerializerInstantiations extends Object
Functions to generate code that instantiates serializers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static com.io7m.jodist.MethodSpec`
  `generateInstantiationMethod(CBTypeDeclarationType type)`
  Generate a serializer instantiation method for the given type declaration.
  `static com.io7m.jodist.MethodSpec`
  `generateInstantiationMethodForProtocol(CBProtocolVersionDeclarationType proto)`
  Generate a serializer instantiation method for the given protocol version.
  `static List<CBCGSerializerInstantiationOperationType>`
  `generateInstantiationStatementsForProtocol(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBProtocolVersionDeclarationType proto)`
  Generate a series of instantiation statements for the protocol version.
  `static List<CBCGSerializerInstantiationOperationType>`
  `generateInstantiationStatementsForRecord(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBRecordType record)`
  Generate a series of instantiation statements for the record.
  `static List<CBCGSerializerInstantiationOperationType>`
  `generateInstantiationStatementsForVariant(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBVariantType variant)`
  Generate a series of instantiation statements for the variant.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### generateInstantiationMethod

    public static com.io7m.jodist.MethodSpec generateInstantiationMethod(CBTypeDeclarationType type)
    Generate a serializer instantiation method for the given type declaration.
    Parameters:
      `type` - The type
    Returns:
      The instantiation method

  - ### generateInstantiationMethodForProtocol

    public static com.io7m.jodist.MethodSpec generateInstantiationMethodForProtocol(CBProtocolVersionDeclarationType proto)
    Generate a serializer instantiation method for the given protocol version.
    Parameters:
      `proto` - The protocol version
    Returns:
      The instantiation method

  - ### generateInstantiationStatementsForProtocol

    public static List<CBCGSerializerInstantiationOperationType> generateInstantiationStatementsForProtocol(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBProtocolVersionDeclarationType proto)
    Generate a series of instantiation statements for the protocol version.
    Parameters:
      `lines` - The program order tracker
      `names` - The name pool
      `proto` - The protocol version
    Returns:
      The instantiation statements

  - ### generateInstantiationStatementsForRecord

    public static List<CBCGSerializerInstantiationOperationType> generateInstantiationStatementsForRecord(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBRecordType record)
    Generate a series of instantiation statements for the record.
    Parameters:
      `lines` - The program order tracker
      `names` - The name pool
      `record` - The record
    Returns:
      The instantiation statements

  - ### generateInstantiationStatementsForVariant

    public static List<CBCGSerializerInstantiationOperationType> generateInstantiationStatementsForVariant(CBCGJavaProgramOrder lines, CBCGJavaNamePool names, CBVariantType variant)
    Generate a series of instantiation statements for the variant.
    Parameters:
      `lines` - The program order tracker
      `names` - The name pool
      `variant` - The variant
    Returns:
      The instantiation statements