Sjawl :: Common

Standard library for obtaining configurations for business logic.

License

License

Categories

Categories

Net
GroupId

GroupId

net.tvburger.sjawl
ArtifactId

ArtifactId

sjawl-common
Last Version

Last Version

0.9.2
Release Date

Release Date

Type

Type

jar
Description

Description

Sjawl :: Common
Standard library for obtaining configurations for business logic.

Download sjawl-common

How to add to project

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

There are no modules declared in this project.

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