org.codehaus.groovy.grails.web.binding
Class GrailsDataBinder
java.lang.Object
org.springframework.validation.DataBinder
org.springframework.web.bind.WebDataBinder
org.springframework.web.bind.ServletRequestDataBinder
org.codehaus.groovy.grails.web.binding.GrailsDataBinder
All Implemented Interfaces: PropertyEditorRegistry
public class GrailsDataBinder extends ServletRequestDataBinder
A data binder that handles binding dates that are specified with a "struct"-like syntax in request parameters.
For example for a set of fields defined as:
This would set the property "myDate" of type java.util.Date with the specified values.
Since:
05-Jan-2006
Author:
Graeme Rocher
Methods inherited from class org.springframework.validation.DataBinder
applyPropertyValues , checkAllowedFields , checkRequiredFields , close , findCustomEditor , getAllowedFields , getBindingErrorProcessor , getBindingResult , getDisallowedFields , getErrors , getInternalBindingResult , getObjectName , getPropertyAccessor , getRequiredFields , getTarget , initBeanPropertyAccess , initDirectFieldAccess , isAllowed , isIgnoreInvalidFields , isIgnoreUnknownFields , registerCustomEditor , registerCustomEditor , setAllowedFields , setBindingErrorProcessor , setDisallowedFields , setExtractOldValueForEditor , setIgnoreInvalidFields , setIgnoreUnknownFields , setMessageCodesResolver , setRequiredFields
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
bean
protected ConfigurablePropertyAccessor bean
GROOVY_DISALLOWED
public static final String [] GROOVY_DISALLOWED
DOMAINCLASS_DISALLOWED
public static final String [] DOMAINCLASS_DISALLOWED
GROOVY_DOMAINCLASS_DISALLOWED
public static final String [] GROOVY_DOMAINCLASS_DISALLOWED
NULL_ASSOCIATION
public static final String NULL_ASSOCIATION
See Also: Constant Field Values
GrailsDataBinder
public GrailsDataBinder (Object target,
String objectName)
Create a new GrailsDataBinder instance.
Parameters: target - target object to bind ontoobjectName - objectName of the target object
createBinder
public static GrailsDataBinder createBinder (Object target,
String objectName,
HttpServletRequest request)
Utility method for creating a GrailsDataBinder instance
Parameters: target - The target object to bind toobjectName - The name of the objectrequest - A request instance
Returns: A GrailsDataBinder instance
createBinder
public static GrailsDataBinder createBinder (Object target,
String objectName)
Utility method for creating a GrailsDataBinder instance
Parameters: target - The target object to bind toobjectName - The name of the object
Returns: A GrailsDataBinder instance
bind
public void bind (PropertyValues propertyValues)
Overrides: bind in class DataBinder
bind
public void bind (PropertyValues propertyValues,
String prefix)
bind
public void bind (ServletRequest request)
Overrides: bind in class ServletRequestDataBinder
bind
public void bind (ServletRequest request,
String prefix)
doBind
protected void doBind (MutablePropertyValues mpvs)
Overrides: doBind in class WebDataBinder
autoCreateIfPossible
protected void autoCreateIfPossible (MutablePropertyValues mpvs)
Method that auto-creates the a type if it is null and is possible to auto-create
Parameters: mpvs - A MutablePropertyValues instance
bindAssociations
protected void bindAssociations (MutablePropertyValues mpvs)
Interrogates the specified properties looking for properites that represent associations to other
classes (e.g., 'author.id'). If such a property is found, this method attempts to load the specified
instance of the association (by ID) and set it on the target object.
Parameters: mpvs - the MutablePropertyValues object holding the parameters from the request
Copyright (c) 2005-2006 The Grails project