public abstract class Binder<T> extends org.osgl.Lang.F3<T,String,ParamValueProvider,T>
A Binder resolves to a certain type of argument out from a String-String map
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
attributes |
static Binder<Boolean[]> |
BOOLEAN_ARRAY |
static Binder<Byte[]> |
BYTE_ARRAY |
static Binder<Character[]> |
CHAR_ARRAY |
static Binder<Double[]> |
DOUBLE_ARRAY |
static Binder<Float[]> |
FLOAT_ARRAY |
static Binder<Integer[]> |
INT_ARRAY |
static Binder<Long[]> |
LONG_ARRAY |
static Binder<boolean[]> |
PRIMITIVE_BOOLEAN_ARRAY |
static Binder<byte[]> |
PRIMITIVE_BYTE_ARRAY |
static Binder<char[]> |
PRIMITIVE_CHAR_ARRAY |
static Binder<double[]> |
PRIMITIVE_DOUBLE_ARRAY |
static Binder<float[]> |
PRIMITIVE_FLOAT_ARRAY |
static Binder<int[]> |
PRIMITIVE_INT_ARRAY |
static Binder<long[]> |
PRIMITIVE_LONG_ARRAY |
static Binder<short[]> |
PRIMITIVE_SHORT_ARRAY |
static Binder<Short[]> |
SHORT_ARRAY |
static Binder<String[]> |
STRING_ARRAY |
protected Type |
targetType |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
addPredefinedBinder(Class<T> type,
Binder<T> resolver) |
T |
apply(T bean,
String argName,
ParamValueProvider params) |
protected <V> V |
attribute(String key)
Get attribute of this binder by key specified
|
Binder<T> |
attribute(String key,
Object value)
Set attribute of this binder.
|
Binder<T> |
attributes(Map<String,Object> attributes)
Set attributes to this binder
|
Binder<T> |
clearAttributes()
Clear all attributes on this binder
|
Type |
genericTargetType() |
static Map<Class,Binder> |
predefined() |
static <T> Binder<T> |
predefined(Class<T> type) |
abstract T |
resolve(T bean,
String model,
ParamValueProvider params)
Resolve bean from param value provider
|
Class<T> |
targetType() |
protected Type targetType
public static final Binder<boolean[]> PRIMITIVE_BOOLEAN_ARRAY
public static final Binder<char[]> PRIMITIVE_CHAR_ARRAY
public static final Binder<byte[]> PRIMITIVE_BYTE_ARRAY
public static final Binder<short[]> PRIMITIVE_SHORT_ARRAY
public static final Binder<int[]> PRIMITIVE_INT_ARRAY
public static final Binder<long[]> PRIMITIVE_LONG_ARRAY
public static final Binder<float[]> PRIMITIVE_FLOAT_ARRAY
public static final Binder<double[]> PRIMITIVE_DOUBLE_ARRAY
public Type genericTargetType()
public abstract T resolve(T bean, String model, ParamValueProvider params)
Resolve bean from param value provider
bean - cached bean instance from last conversation in the same session. Or null if not appliedmodel - the name to specify the modelparams - the param value providerpublic Binder<T> attribute(String key, Object value)
Set attribute of this binder.
Note use this method only on new resolver instance instead of shared instance
key - the attribute keyvalue - the attribute valuepublic Binder<T> attributes(Map<String,Object> attributes)
Set attributes to this binder
Note use this method only on new resolver instance instead of shared instance
attributes - the attributes mappublic Binder<T> clearAttributes()
Clear all attributes on this binder
protected <V> V attribute(String key)
Get attribute of this binder by key specified
V - the generic type variable of attribute valuekey - the attribute keypublic final T apply(T bean, String argName, ParamValueProvider params) throws org.osgl.exception.NotAppliedException, org.osgl.Lang.Break
org.osgl.exception.NotAppliedExceptionorg.osgl.Lang.BreakCopyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.