Standard Java Configuration Library

Standard library for obtaining configurations for business logic.

Лицензия

Лицензия

Категории

Категории

Сеть config Библиотеки уровня приложения Configuration
Группа

Группа

net.tvburger.sjawl
Идентификатор

Идентификатор

sjawl-config
Последняя версия

Последняя версия

0.9.2
Дата

Дата

Тип

Тип

pom
Описание

Описание

Standard Java Configuration Library
Standard library for obtaining configurations for business logic.
Ссылка на сайт

Ссылка на сайт

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

Скачать sjawl-config

Имя Файла Размер
sjawl-config-0.9.2.pom 4 KB
Обзор

Как подключить последнюю версию

<!-- 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"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • 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

tvburger@gmail.com, http://www.tvburger.net, https://github.com/tvburger/sjawl-config

Версии библиотеки

Версия
0.9.2