Class CodeGeneratorUtils

java.lang.Object
org.pkl.core.util.CodeGeneratorUtils

public final class CodeGeneratorUtils extends Object
Utilities shared across Java dnd Kotlin code generators.
  • Method Details

    • isRepresentableAsEnum

      public static boolean isRepresentableAsEnum(PType type, @Nullable @Nullable Set<String> collector)
    • isRepresentableAsString

      public static boolean isRepresentableAsString(PType type)
    • toEnumConstantName

      @Nullable public static @Nullable String toEnumConstantName(String pklStringLiteral)
      Converts the given Pkl string literal to an idiomatic enum constant name. Returns null if and only if the string literal could not be converted.