Package nl.vpro.util
Class ProviderAndBuilder
- java.lang.Object
-
- nl.vpro.util.ProviderAndBuilder
-
public class ProviderAndBuilder extends Object
If you have a provider implementation based on a builder, you can fill the fields of the provider to the builder using reflection. Providers can come in usefull with IOC-frameworks like guice. The idea is to putNamed
annotation on the fields of the Provider.- Since:
- 1.69
- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Constructor Description ProviderAndBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Object
convert(Object o, Class<?> dest)
static <T,S>
Sfill(javax.inject.Provider<T> provider, S builder)
static <T,S>
SfillAndCatch(javax.inject.Provider<T> provider, S builder)
protected static Method
getBuilderMethod(Class<?> builderClass, String name, Class<?> type)
-
-
-
Method Detail
-
fill
public static <T,S> S fill(javax.inject.Provider<T> provider, S builder) throws InvocationTargetException, IllegalAccessException, ClassNotFoundException
-
getBuilderMethod
protected static Method getBuilderMethod(Class<?> builderClass, String name, Class<?> type)
-
fillAndCatch
public static <T,S> S fillAndCatch(javax.inject.Provider<T> provider, S builder)
-
-