Class MetadataUtils

java.lang.Object
io.micronaut.aot.core.config.MetadataUtils

public class MetadataUtils extends Object
Runtime reflection utils for analyzing AOT modules.
  • Constructor Details

    • MetadataUtils

      public MetadataUtils()
  • Method Details

    • findMetadata

      public static Optional<AOTModule> findMetadata(Class<?> clazz)
      Returns the AOT module annotation for a class, if present.
      Parameters:
      clazz - the class to look for
      Returns:
      the module annotation.
    • findOption

      public static Option findOption(Class<?> clazz, String name)
      Returns the option with the corresponding name. If the supplied class is not annotated with AOTModule invocation will fail.
      Parameters:
      clazz - the AOT module class
      name - the name of the option
      Returns:
      the corresponding option
    • toPropertiesSample

      public static String toPropertiesSample(Option option)
      Returns a string representation of the option, for use in properties files.
      Parameters:
      option - the option to convert to sample text.
      Returns:
      a sample
    • isEnabledOn

      public static boolean isEnabledOn(Runtime runtime, AOTCodeGenerator module)
    • isEnabledOn

      public static boolean isEnabledOn(Runtime runtime, AOTModule module)