Lumio Vault

A library providing DI with JSR-330 annotations and extensible YML/JSON configuration

Лицензия

Лицензия

Группа

Группа

com.lumiomedical
Идентификатор

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

lumio-vault
Последняя версия

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

0.11
Дата

Дата

Тип

Тип

jar
Описание

Описание

Lumio Vault
A library providing DI with JSR-330 annotations and extensible YML/JSON configuration
Ссылка на сайт

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

https://github.com/lumio-medical/lumio-vault
Организация-разработчик

Организация-разработчик

Lumio Medical
Система контроля версий

Система контроля версий

https://github.com/lumio-medical/lumio-vault

Скачать lumio-vault

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

<!-- https://jarcasting.com/artifacts/com.lumiomedical/lumio-vault/ -->
<dependency>
    <groupId>com.lumiomedical</groupId>
    <artifactId>lumio-vault</artifactId>
    <version>0.11</version>
</dependency>
// https://jarcasting.com/artifacts/com.lumiomedical/lumio-vault/
implementation 'com.lumiomedical:lumio-vault:0.11'
// https://jarcasting.com/artifacts/com.lumiomedical/lumio-vault/
implementation ("com.lumiomedical:lumio-vault:0.11")
'com.lumiomedical:lumio-vault:jar:0.11'
<dependency org="com.lumiomedical" name="lumio-vault" rev="0.11">
  <artifact name="lumio-vault" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lumiomedical', module='lumio-vault', version='0.11')
)
libraryDependencies += "com.lumiomedical" % "lumio-vault" % "0.11"
[com.lumiomedical/lumio-vault "0.11"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
javax.inject : javax.inject jar 1
com.noleme : noleme-commons jar [0.17,)
com.noleme : noleme-json jar [0.9,)
org.slf4j : slf4j-api jar 1.7.30

test (2)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-simple jar 1.7.30
org.junit.jupiter : junit-jupiter jar 5.6.0

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

Данный проект не имеет модулей.

Lumio Vault

GitHub Workflow Status Maven Central Repository javadoc GitHub FOSSA Status

A library providing DI with JSR-330 annotations and extensible YML/JSON configuration.

Implementations found in this package shouldn't be tied to any specific Lumio project.

Note: This library is considered as "in beta" and as such significant API changes may occur without prior warning.

I. Installation

Add the following in your pom.xml:

<dependency>
    <groupId>com.lumiomedical</groupId>
    <artifactId>lumio-vault</artifactId>
    <version>0.11</version>
</dependency>

II. Notes on Structure and Design

TODO

III. Usage

A basic example of using this library with a yml configuration file:

Given a dummy configuration file my_conf.yml:

variables:
    my_var: 12.34
    my_other_var: "interesting"
    my_env_var: ${MY_VAR}

services:
    my_service:
        class: "me.company.MyClass"
        constructor:
            - "not so interesting"
            - "##my_var##"

    my_other_service:
        class: "me.company.MyOtherClass"
        constructor:
            - "##my_other_var##"

We could perform injection via annotations on a dummy class such as:

public class MyService
{
    private final MyClass service;
    private final MyOtherClass otherService;

    @Inject
    public MyService(MyClass service, @Named("my_other_service") MyOtherClass otherService)
    {
        this.service = service;
        this.otherService = otherService;
    }
}

..and do the following:

MyService service = Vault.with("my_conf.yml").instance(MyService.class);

It's also possible to use field annotations and proceed the following way:

public class MyService
{
    @Inject private MyClass service;
    @Inject private MyOtherClass otherService;
}
MyService service = Vault.with("my_conf.yml").inject(new MyService());

..one of the neat things we can do, is programmatically override parts of the configuration:

MyService service = Vault.with("my_conf.yml", defs -> {
    defs.setVariable("my_var", 34.56); //my_var will now equal 34.56 upon injection
}).inject(new MyService());

Alternatively we could directly query one of the declared services:

MyClass myService = Vault.with("my_conf.yml").instance(Key.of(MyClass.class, "my_service"));

Other features that will need to be documented include:

  • import of dependency json/yml files
  • service method invocation
  • service instantiation via static method call
  • service aliasing
  • service closing
  • service container composition
  • custom modules
  • custom preprocessing routines

TODO

IV. Dev Installation

This project will require you to have the following:

  • Java 11+
  • Git (versioning)
  • Maven (dependency resolving, publishing and packaging)

License

FOSSA Status

com.lumiomedical

Lumio Medical

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

Версия
0.11
0.10
0.9.1
0.9
0.8
0.7