- All Implemented Interfaces:
Handler
Handler
that generates classes that returns file contents as String
s.
For each resource, generates a class with a name derived from the resource name
using Namer.simplifyResourceName(String)
and Namer.nameType(String)
.
The class will have a static method called text
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
All configuration is optional.
"UTF-8" is assumed if "encoding" is not set and this is the recommended encoding.
Use "visibility" to make the generated classes public.
Strategy:CfgStrategy.AUTO
:CfgStrategy.INLINE
for files up to 65535B when encoded as modified UTF-8 - the limit for a String constant;CfgStrategy.LAZY
otherwiseCfgStrategy.INLINE
: files becomeString
literalsCfgStrategy.CONST
: alias forCfgStrategy.INLINE
CfgStrategy.LAZY
: files are loaded using theClassLoader
The lazy strategy requires that the resource file be provided at runtime. The inline strategy will break down as the resource file approaches 500MB due to class file limitations.
-
handle
Description copied from interface:Handler
Handles the context resources.
-