Table of Contents

Text

Text contains tools for generating text from various objects.

TextFactory

TextFactory is a singleton class that builds strings from Text objects and contains references to various tools to use in generation. Use the build(Text) and build(Text…) methods for generation. The implementation is annotated as a @Component for the Injector module and will be automatically instantiated by it.

TextConfiguration

TextConfiguration is a configuration object that is used by all configurable classes of the module. ConfigurationKey is used to determine the type and default value of a configuration entry, and values to configuration entries may be static objects or a Supplier<T>. Configuration keys specific to a single class are contained in the class, and generic keys are in the ConfigurationKeys utility class. These generic keys are:

Text

Text is an interface that contains a text generation method and possibly references to other objects to aid in generation. There are multiple default implementations of text:

NumberFormatter

NumberFormatter is an interface that formats a BigDecimal number to a string representation. It uses a NumberSuffixFormatter to separate the number into mantissa and exponent parts when necessary. There are three default implementations of number formatter:

All NumberFormatter implementations are annotated with @Component for the Injector module and will be automatically instantiated by it.

NumberSuffixFormatter

NumberSuffixFormatter is an interface that separates a BigDecimal number into a mantissa and an exponent. It is used by number formatters. There are three default implementations of number suffix formatter:

All NumberSuffixFactory implementations are annotated with @Component for the Injector module and will be automatically instantiated by it.

NameConverter<T>

NameConverter<T> is an interface that converts an object to a singular and optionally also a plural name. The name converter is used by NameText<T>. There are two default implementations of name converter:

All NameConverter<T> implementations are annotated with @Component for the Injector module and will be automatically instantiated by it.

PluralConverter

PluralConverter is an interface that converts a singular string into plural form. The default implementation DefaultPluralConverter has three rules:

The implementation is annotated as a @Component for the Injector module and will be automatically instantiated by it.