Class EnumJsonGenerator

java.lang.Object
org.ek9lang.compiler.phase7.synthesis.AbstractSyntheticGenerator
org.ek9lang.compiler.phase7.synthesis.EnumJsonGenerator

final class EnumJsonGenerator extends AbstractSyntheticGenerator
Generates synthetic IR for the enum _json ($$) operator.

Enum fields use Java primitives:

  • _name: java.lang.String
  • _isEnumSet: boolean (primitive)

Returns JSON representation of the enum's name as a JSON string:

JSON _json():
  if !this._isSet() -> return unset
  namePrimitive = this._name (java.lang.String)
  nameEk9 = String._of(namePrimitive)
  return nameEk9._json()

The JSON representation is a simple string value, e.g., "MONDAY"