Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.web.binding
Class DataBindingUtils

    java.lang.Object
      org.codehaus.groovy.grails.web.binding.DataBindingUtils

    public class DataBindingUtils

extends Object

Utility methods to perform data binding from Grails objects

Since:
  1.0

  Created: Sep 13, 2007 Time: 2:34:11 PM
Author:
  Graeme Rocher

Constructor Summary
`DataBindingUtils()`

Method Summary
`static void` | `assignBidirectionalAssociations(Object object, Map source, GrailsDomainClass domainClass)` Associations both sides of any bidirectional relationships found in the object and source map to bind
`static BindingResult` | `bindObjectToDomainInstance(GrailsDomainClass domain, Object object, Object source)` Binds the given source object to the given target object performing type conversion if necessary
`static BindingResult` | `bindObjectToDomainInstance(GrailsDomainClass domain, Object object, Object source, List include, List exclude, String filter)` Binds the given source object to the given target object performing type conversion if necessary
`static BindingResult` | `bindObjectToInstance(Object object, Object source)` Binds the given source object to the given target object performing type conversion if necessary
`static BindingResult` | `bindObjectToInstance(Object object, Object source, List include, List exclude, String filter)` Binds the given source object to the given target object performing type conversion if necessary

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataBindingUtils

    public DataBindingUtils()

Method Detail

### assignBidirectionalAssociations

    public static void assignBidirectionalAssociations(Object object,
                                                       Map source,
                                                       GrailsDomainClass domainClass)

  Associations both sides of any bidirectional relationships found in the object and source map to bind

  Parameters:
    `object` - The object
    `source` - The source map
    `domainClass` - The DomainClass for the object

### bindObjectToInstance

    public static BindingResult bindObjectToInstance(Object object,
                                                     Object source)

  Binds the given source object to the given target object performing type conversion if necessary

  Parameters:
    `object` - The object to bind to
    `source` - The source object
  Returns:
    A BindingResult or null if it wasn't successful

### bindObjectToDomainInstance

    public static BindingResult bindObjectToDomainInstance(GrailsDomainClass domain,
                                                           Object object,
                                                           Object source)

  Binds the given source object to the given target object performing type conversion if necessary

  Parameters:
    `domain` - The GrailsDomainClass instance
    `object` - The object to bind to
    `source` - The source object
  Returns:
    A BindingResult or null if it wasn't successful
  See Also:
    `GrailsDomainClass`

### bindObjectToInstance

    public static BindingResult bindObjectToInstance(Object object,
                                                     Object source,
                                                     List include,
                                                     List exclude,
                                                     String filter)

  Binds the given source object to the given target object performing type conversion if necessary

  Parameters:
    `object` - The object to bind to
    `source` - The source object
    `include` - The list of properties to include
    `exclude` - The list of properties to exclud
    `filter` - The prefix to filter by
  Returns:
    A BindingResult or null if it wasn't successful

### bindObjectToDomainInstance

    public static BindingResult bindObjectToDomainInstance(GrailsDomainClass domain,
                                                           Object object,
                                                           Object source,
                                                           List include,
                                                           List exclude,
                                                           String filter)

  Binds the given source object to the given target object performing type conversion if necessary

  Parameters:
    `domain` - The GrailsDomainClass instance
    `object` - The object to bind to
    `source` - The source object
    `include` - The list of properties to include
    `exclude` - The list of properties to exclud
    `filter` - The prefix to filter by
  Returns:
    A BindingResult or null if it wasn't successful
  See Also:
    `GrailsDomainClass`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2005-2009 The Grails project