CDI Converters

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Группа

Группа

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

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

cdi-converters
Последняя версия

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

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

CDI Converters
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Система контроля версий

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

https://github.com/rmannibucau/cdi-converters

Скачать cdi-converters

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.apache.deltaspike.core : deltaspike-core-api jar 0.3-incubating

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.openejb : javaee-api jar 6.0-5

test (3)

Идентификатор библиотеки Тип Версия
org.apache.openejb : arquillian-openejb-embedded-4 jar 4.5.1
org.jboss.arquillian.junit : arquillian-junit-container jar 1.0.3.Final
junit : junit jar 4.11

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

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

Build Status

Goal

Define converters (static method or not) then be able to use them for single object or collections through ObjectConverter interface.

Example

public static class LenConverter {
    // static method
    
    @Converter(in = In.class, out = Out.class)
    public static Out convert(final In in) {
        return new Out(in.value.length());
    }

    // or use completely CDI

    @Inject
    private Helper helper;

    @Converter(in = String.class, out = String.class)
    public String convert(final String in) {
        return helper.foo(in);
    }
}

then in another bean:

@Inject
@Converter(in = In.class, out = Out.class)
private ObjectConverter<In, Out> len;

// ...
assertEquals(3, len.to(new In("foo")).len);

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

Версия
1.0