Class GenerateConstantsFromProperties

java.lang.Object
uk.autores.processing.handlers.GenerateConstantsFromProperties
All Implemented Interfaces:
uk.autores.handling.Handler

public final class GenerateConstantsFromProperties extends Object implements uk.autores.handling.Handler
Use this code generation Handler to prevent misspelled keys with ResourceBundle. For every Properties file defined as a resource:
  • Generates a class based on the .properties file name using Namer.simplifyResourceName(String) and Namer.nameType(String)
  • Adds a String constant named from the property key using Namer.nameConstant(String)
  • Constructor Details

    • GenerateConstantsFromProperties

      public GenerateConstantsFromProperties()
      Ctor
  • Method Details

    • config

      public Set<uk.autores.handling.ConfigDef> config()

      All configuration is optional.

      Use "visibility" to make the generated classes public.

      Specified by:
      config in interface uk.autores.handling.Handler
      Returns:
      visibility
      See Also:
    • handle

      public void handle(uk.autores.handling.Context context) throws Exception
      Specified by:
      handle in interface uk.autores.handling.Handler
      Throws:
      Exception