|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.beans.BinderProvider
public class BinderProvider
Manage a cache of Binder objects.
registerBinder api.
BinderTo use several binders of the the same types, you can moreover specify a context name of your binder :mybinder = ...; registerBinder(myNewBinder);
BinderThen you can obtained them back via the apimybinder = ...; registerBinder(myBinder, "One");
Binderor with a context name :mybinder = getBinder(User.class,UserDTO);
Bindermybinder = getBinder(User.class,UserDTO.class, "One");
Binder,
BinderBuilder| Nested Class Summary | |
|---|---|
static class |
BinderProvider.BinderEntry
Definition of an binder entry (source and target types + context name). |
| Field Summary | |
|---|---|
protected static Map<BinderProvider.BinderEntry,Binder<?,?>> |
binders
Cache of registred binders indexed by their unique entry |
| Constructor Summary | |
|---|---|
BinderProvider()
|
|
| Method Summary | ||
|---|---|---|
static void |
clear()
|
|
static
|
getBinder(Class<S> sourceType)
Gets the registred mirror binder (source type = target type) with no context name specified. |
|
static
|
getBinder(Class<S> sourceType,
Class<T> targetType)
Gets the registred binder given his types with no context name. |
|
static
|
getBinder(Class<S> sourceType,
Class<T> targetType,
String name)
Gets the registred binder given his types and his context's name. |
|
static
|
getBinder(Class<S> sourceType,
String name)
Gets the registred mirror binder (source type = target type) with the given context name. |
|
protected static Map<BinderProvider.BinderEntry,Binder<?,?>> |
getBinders()
|
|
static void |
registerBinder(Binder<?,?> binder)
Register a binder with no context name. |
|
static void |
registerBinder(Binder<?,?> binder,
String name)
Register a binder with a context name. |
|
static void |
registerBinder(BinderBuilder builder)
Register a binder with no context's name from a BinderBuilder. |
|
static
|
registerBinder(BinderBuilder builder,
Class<B> binderType)
Register a binder with no context's name from a BinderBuilder. |
|
static
|
registerBinder(BinderBuilder builder,
Class<B> binderType,
String name)
Register a binder with a context's name from a BinderBuilder. |
|
static void |
registerBinder(BinderBuilder builder,
String name)
Register a binder with a context's name from a BinderBuilder. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Map<BinderProvider.BinderEntry,Binder<?,?>> binders
| Constructor Detail |
|---|
public BinderProvider()
| Method Detail |
|---|
public static <S> Binder<S,S> getBinder(Class<S> sourceType)
S - the type of source and targetsourceType - the type of source and target
null if not found.
public static <S> Binder<S,S> getBinder(Class<S> sourceType,
String name)
S - the type of source and targetsourceType - the type of source and targetname - the context's name of the searched binder
null if not found.
public static <S,T> Binder<S,T> getBinder(Class<S> sourceType,
Class<T> targetType)
S - the type of sourceT - the type of targetsourceType - the type of sourcetargetType - the type of target
null if not found.
public static <S,T> Binder<S,T> getBinder(Class<S> sourceType,
Class<T> targetType,
String name)
S - the type of sourceT - the type of targetsourceType - the type of sourcetargetType - the type of targetname - the context's name of the searched binder
null if not found.public static void registerBinder(Binder<?,?> binder)
binder - the binder to register.public static void registerBinder(BinderBuilder builder)
BinderBuilder.
Note: If a previous binder with same definition exists, it will
be overriden by the new binder.
builder - the builder which contains builder model to useBinderBuilder.createBinder(Class)
public static <B extends Binder<?,?>> void registerBinder(BinderBuilder builder,
Class<B> binderType)
BinderBuilder.
Note: If a previous binder with same definition exists, it will
be overriden by the new binder.
builder - the builder which contains builder model to usebinderType - the type of binder to instanciate and register.BinderBuilder.createBinder(Class)
public static void registerBinder(BinderBuilder builder,
String name)
BinderBuilder.
Note: If a previous binder with same definition exists, it will
be overriden by the new binder.
builder - the builder which contains builder model to usename - the context's nameBinderBuilder.createBinder(Class)
public static <B extends Binder<?,?>> void registerBinder(BinderBuilder builder,
Class<B> binderType,
String name)
BinderBuilder.
Note: If a previous binder with same definition exists, it will
be overriden by the new binder.
builder - the builder which contains builder model to usebinderType - the type of binder to instanciate and register.name - the context's nameBinderBuilder.createBinder(Class)
public static void registerBinder(Binder<?,?> binder,
String name)
binder - the binder to register.name - the context's nameprotected static Map<BinderProvider.BinderEntry,Binder<?,?>> getBinders()
public static void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||