Introduction

smartics-properties is a library for Java to declare and define properties and to access them from an application in a convenient way.

Convenience means that properties are easily

  1. declared (as an annotated Java interface)
  2. defined (e.g. in form of properties files on the classpath)
  3. resolved (e.g. construct properties with placeholders like ${server.url}/index.html)
  4. converted (e.g. to an URL or custom instance)
  5. validated (e.g. mandatory values or a value within a given range)
  6. accessed (typesafe)
  7. stored (e.g. file system or database)
  8. documented (e.g. to display error information to the user)

Properties are used to configure an application. This is what the well-known Properties class of the Java SDK is all about: Simple key/value tuples of type String. It is quite easy to load properties files from a stream or from the class path. But a standardized way to provide property values is not defined. In other words: The developer has to define a location to place the properties file and write the couple of lines of code to access it. Once in memory, the developer has to manage the properties and make it accessible by all clients.

This would be more convenient: the developer declares the properties at one place and the deployer provides the property values at another. And without further ado the system makes the property values available through a simple API. This is what smartics-properties can do for you.

Please check out our 5 minutes tutorial to get an overview over this library.