Standard Java Configuration Library

Standard library for obtaining configurations for business logic.

License

License

Categories

Categories

Net config Application Layer Libs Configuration
GroupId

GroupId

net.tvburger.sjawl
ArtifactId

ArtifactId

sjawl-config
Last Version

Last Version

0.9.2
Release Date

Release Date

Type

Type

pom
Description

Description

Standard Java Configuration Library
Standard library for obtaining configurations for business logic.
Project URL

Project URL

https://github.com/tvburger/sjawl-config

Download sjawl-config

Filename Size
sjawl-config-0.9.2.pom 4 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/net.tvburger.sjawl/sjawl-config/ -->
<dependency>
    <groupId>net.tvburger.sjawl</groupId>
    <artifactId>sjawl-config</artifactId>
    <version>0.9.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/net.tvburger.sjawl/sjawl-config/
implementation 'net.tvburger.sjawl:sjawl-config:0.9.2'
// https://jarcasting.com/artifacts/net.tvburger.sjawl/sjawl-config/
implementation ("net.tvburger.sjawl:sjawl-config:0.9.2")
'net.tvburger.sjawl:sjawl-config:pom:0.9.2'
<dependency org="net.tvburger.sjawl" name="sjawl-config" rev="0.9.2">
  <artifact name="sjawl-config" type="pom" />
</dependency>
@Grapes(
@Grab(group='net.tvburger.sjawl', module='sjawl-config', version='0.9.2')
)
libraryDependencies += "net.tvburger.sjawl" % "sjawl-config" % "0.9.2"
[net.tvburger.sjawl/sjawl-config "0.9.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • common
  • api
  • properties
  • example

sjawl-config

Standard Java Configuration Library

Introduction

Almost all code need configuration, and this provides a extensible plug-n-play solution for your configuration needs.

The concept of configuration has been divided into 3 parts:

  • the method of specifying configurations,
  • the logic of interpreting a configuration specification, and
  • the usage of a configuration.

Specifying a configuration

The method can be defined by a SpecificationLoader using the java SPI mechanism. Specify the avialable loaders using META-INF/services/net.tvburger.sjawl.config.spi.SpecificationLoader.

Interpreting a configuration specification

The logic how to interpret a specification to obtain a configuration can be defined by a ConfigurationParser. Specify the available parsers using META-INF/services/net.tvburger.sjwal.config.spi.ConfigurationParser.

Using a Configuration

To use a configuration, use the ConfigurationProvider and ask for the specific configuration.

Example

See: example/src/test/java/net/tvburger/sjawl/config/example/ExampleTest.java

    public void exampleConfigurationUsage() {
    
        // Obtain a configuration provider
        ConfigurationProvider provider = ConfigurationProvider.Singleton.get();
        
        // Get your configuration from the provider
        ExampleConfiguration configuration = provider.getConfiguration(ExampleConfiguration.class);
        
        // Use your configuration
        if (configuration.isSuperGame()) {
            System.out.println("What a great game!");
        }
        
    }

Contact

[email protected], http://www.tvburger.net, https://github.com/tvburger/sjawl-config

Versions

Version
0.9.2