Class GenerateStringsFromText

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

public class GenerateStringsFromText extends Object implements uk.autores.handling.Handler

Handler that generates classes that returns file contents as Strings.

Generates a class. Class name is derived from package name using Namer.nameType(String) if the name property is unset.

For each resource, generates a method with a name derived from the resource name using Namer.simplifyResourceName(String) and Namer.nameMember(String) that returns the resource as a String.

Resource files over Integer.MAX_VALUE in size will result in an error during compilation.

The CharsetDecoder is configured with CodingErrorAction.REPORT on malformed input or unmappable characters which will result in build failures.

  • Constructor Details

    • GenerateStringsFromText

      public GenerateStringsFromText()
      Ctor
  • Method Details

    • config

      public Set<uk.autores.handling.ConfigDef> config()
      Supported config.
      Specified by:
      config in interface uk.autores.handling.Handler
      Returns:
      visibility, encoding, strategy, name
    • handle

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