package axiell
Package Members
- package util
Axiell Utilities Project
Axiell Utilities Project
A set of classes and traits that provide a simple mechanism for the internationalisation of strings and error handling. A mechanism is also supplied to read an application's configuration resource. All methods have been designed to be referentially transparent without the introduction of an effectful library (e.g. cats).
Imports
The utility classes/traits can be imported in the usual way, however it is necessary to include the Implicits object if the
showLocal
andjsonLocal
type class methods are used, similarly for theread
method on Configure.Example:
import com.axiell.util.Implicits._
A shorthand way to gain access to all utility classes is to import:
import com.axiell.util._ import com.axiell.util.Implicits._
For more detail on project see the
root
package page.
Documentation for the Axiell Utilities Project
Overview
The Axiell Utilities Project attempts to provide a small library of classes and object applicable to most Axiell developments. The library is not geared towards any one project and so should be useful for new projects as well as existing ones.
The library is based on a few simple principles, namely:
Package structure
The
package consists of a number of utilities, where each utility provides a single piece of functionality.com.axiell.util
Notable utilities are:
Configure
generic configuration reader allowing application settings defined as resources to be interrogated.Error
generic error handling class defining a locale independent error message along with details relating to the context of the error. The context may include an exception and other relevant values.Formatter
retrieves and formats a locale specific string from a specified resource bundle. The formatting is specified in aC
printf style.Implicits
implements implicit methods and classes used to pimp methods onto existing classes (e.g.fold()
method toBoolean
class) and to provide implicit implementations for the JsonLocal and ShowLocal type classes.JsonLocal
type class used to output locale specific JSON structures. Implementations exist for Message and Error.Message
provides a locale independent mechanism for handling strings. The strings for a given locale are stored in resource bundles that are accessed when the message is to be displayed.ShowLocal
type class used to show locale specific strings. Allows Message and Error to be converted to a given language string.Dependencies
The list of dependencies are:
Typesafe Config
a generic configuration file reader. The library is used by theConfigure
class to access settings stored as resources within an application.