Package play.data.binding
Class As.DEFAULT
- java.lang.Object
-
- play.data.binding.As.DEFAULT
-
- All Implemented Interfaces:
TypeBinder<java.lang.Object>
,TypeUnbinder<java.lang.Object>
- Enclosing class:
- As
public static final class As.DEFAULT extends java.lang.Object implements TypeBinder<java.lang.Object>, TypeUnbinder<java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description DEFAULT()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
bind(java.lang.String name, java.lang.annotation.Annotation[] annotations, java.lang.String value, java.lang.Class actualClass, java.lang.reflect.Type genericType)
Called when your parameter needs to be bound.boolean
unBind(java.util.Map<java.lang.String,java.lang.Object> result, java.lang.Object src, java.lang.Class<?> srcClazz, java.lang.String name, java.lang.annotation.Annotation[] annotations)
-
-
-
Method Detail
-
bind
public java.lang.Object bind(java.lang.String name, java.lang.annotation.Annotation[] annotations, java.lang.String value, java.lang.Class actualClass, java.lang.reflect.Type genericType)
Description copied from interface:TypeBinder
Called when your parameter needs to be bound.- Specified by:
bind
in interfaceTypeBinder<java.lang.Object>
- Parameters:
name
- the name of you parameter ie myparam for a simple param but can also be a complex one : mybean.address.streetannotations
- An array of annotation that may be bound to your method parameter or your bean propertyvalue
- the actual value as a string that needs to be boundactualClass
- The class of the object you want to associate the value withgenericType
- The generic type associated with the object you want to bound the value to- Returns:
- the 'bound' object for example a date object if the value was '12/12/2002'
-
unBind
public boolean unBind(java.util.Map<java.lang.String,java.lang.Object> result, java.lang.Object src, java.lang.Class<?> srcClazz, java.lang.String name, java.lang.annotation.Annotation[] annotations) throws java.lang.Exception
- Specified by:
unBind
in interfaceTypeUnbinder<java.lang.Object>
- Parameters:
result
- The result containersrc
- the object you want to unbindsrcClazz
- The class of the object you want to associate the value withname
- the name of you parameter ie myparam for a simple param but can also be a complex one : mybean.address.streetannotations
- An array of annotation that may be bound to your method parameter or your bean property- Returns:
- true if unwinder is successful, otherwise false and will use the default unbinder
- Throws:
java.lang.Exception
- if problem occurred
-
-