Class JvmDescriptorConverter

java.lang.Object
org.ek9lang.compiler.backend.jvm.JvmDescriptorConverter
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>

final class JvmDescriptorConverter extends Object implements UnaryOperator<String>
Converts EK9 type names to JVM type descriptors. Handles Java primitives, EK9 built-in types, and custom types. Implements UnaryOperator for functional composition and reuse.

JVM Type Descriptors: - Java primitives: Z (boolean), B (byte), C (char), S (short), I (int), J (long), F (float), D (double) - Void: V - EK9 built-in types: Lorg/ek9/lang/String;, Lorg/ek9/lang/Integer;, etc. - Object types: Lpackage/ClassName;

  • Constructor Details

    • JvmDescriptorConverter

      JvmDescriptorConverter(FullyQualifiedJvmName fullyQualifiedJvmName)
      Create converter with JVM name resolution capability.
      Parameters:
      fullyQualifiedJvmName - Utility for converting EK9 names to JVM internal names
  • Method Details

    • apply

      public String apply(String ek9TypeName)
      Convert EK9 type name to JVM descriptor format. Handles Java primitives, EK9 built-in types, and custom types.
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      ek9TypeName - The EK9 type name to convert
      Returns:
      JVM type descriptor (e.g., "Z" for boolean, "Lorg/ek9/lang/String;" for EK9 String)