|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.codehaus.groovy.grails.web.binding.DataBindingUtils
@java.lang.SuppressWarnings("rawtypes")
public class DataBindingUtils
extends java.lang.Object
Utility methods to perform data binding from Grails objects.
| Field Summary | |
|---|---|
static java.lang.String |
DATA_BINDER_BEAN_NAME
|
| Method Summary | |
|---|---|
static void
|
assignBidirectionalAssociations(java.lang.Object object, java.util.Map source, GrailsDomainClass domainClass)
Associations both sides of any bidirectional relationships found in the object and source map to bind |
static org.springframework.validation.BindingResult
|
bindObjectToDomainInstance(GrailsDomainClass domain, java.lang.Object object, java.lang.Object source)
Binds the given source object to the given target object performing type conversion if necessary |
static org.springframework.validation.BindingResult
|
bindObjectToDomainInstance(GrailsDomainClass domain, java.lang.Object object, java.lang.Object source, java.util.List include, java.util.List exclude, java.lang.String filter)
Binds the given source object to the given target object performing type conversion if necessary |
static org.springframework.validation.BindingResult
|
bindObjectToInstance(java.lang.Object object, java.lang.Object source)
Binds the given source object to the given target object performing type conversion if necessary |
static org.springframework.validation.BindingResult
|
bindObjectToInstance(java.lang.Object object, java.lang.Object source, java.util.List include, java.util.List exclude, java.lang.String filter)
Binds the given source object to the given target object performing type conversion if necessary |
static void
|
bindToCollection(java.lang.Class targetType, java.util.Collection collectionToPopulate, CollectionDataBindingSource collectionBindingSource)
For each DataBindingSource provided by collectionBindingSource a new instance of targetType is created, data binding is imposed on that instance with the DataBindingSource and the instance is added to the end of collectionToPopulate |
static void
|
bindToCollection(java.lang.Class targetType, java.util.Collection collectionToPopulate, javax.servlet.ServletRequest request)
|
static java.util.Map
|
convertPotentialGStrings(java.util.Map args)
|
static CollectionDataBindingSource
|
createCollectionDataBindingSource(GrailsApplication grailsApplication, java.lang.Class bindingTargetType, java.lang.Object bindingSource)
|
static DataBindingSource
|
createDataBindingSource(GrailsApplication grailsApplication, java.lang.Class bindingTargetType, java.lang.Object bindingSource)
|
static DataBindingSourceRegistry
|
getDataBindingSourceRegistry(GrailsApplication grailsApplication)
|
protected static java.lang.String[]
|
getMessageCodes(java.lang.String messageCode, java.lang.Class objectType)
|
static MimeType
|
getMimeType(GrailsApplication grailsApplication, java.lang.Object bindingSource)
|
static MimeTypeResolver
|
getMimeTypeResolver(GrailsApplication grailsApplication)
|
static MimeType
|
resolveMimeType(java.lang.Object bindingSource, MimeTypeResolver mimeTypeResolver)
|
| Methods inherited from class java.lang.Object | |
|---|---|
| java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
| Field Detail |
|---|
public static final java.lang.String DATA_BINDER_BEAN_NAME
| Method Detail |
|---|
public static void assignBidirectionalAssociations(java.lang.Object object, java.util.Map source, GrailsDomainClass domainClass)
object - The objectsource - The source mapdomainClass - The DomainClass for the object
public static org.springframework.validation.BindingResult bindObjectToDomainInstance(GrailsDomainClass domain, java.lang.Object object, java.lang.Object source)
domain - The GrailsDomainClass instanceobject - The object to bind tosource - The source object
@java.lang.SuppressWarningspublic static BindingResult bindObjectToDomainInstance(GrailsDomainClass domain, Object object, public static org.springframework.validation.BindingResult bindObjectToDomainInstance(GrailsDomainClass domain, java.lang.Object object, java.lang.Object source, java.util.List include, java.util.List exclude, java.lang.String filter)
domain - The GrailsDomainClass instanceobject - The object to bind tosource - The source objectinclude - The list of properties to includeexclude - The list of properties to excludfilter - The prefix to filter by
public static org.springframework.validation.BindingResult bindObjectToInstance(java.lang.Object object, java.lang.Object source)
object - The object to bind tosource - The source object
public static org.springframework.validation.BindingResult bindObjectToInstance(java.lang.Object object, java.lang.Object source, java.util.List include, java.util.List exclude, java.lang.String filter)
object - The object to bind tosource - The source objectinclude - The list of properties to includeexclude - The list of properties to excludfilter - The prefix to filter by
public static void bindToCollection(java.lang.Class targetType, java.util.Collection collectionToPopulate, CollectionDataBindingSource collectionBindingSource)
targetType - The type of objects to create, must be a concrete classcollectionToPopulate - A collection to populate with new instances of targetTypecollectionBindingSource - A CollectionDataBindingSource
public static void bindToCollection(java.lang.Class targetType, java.util.Collection collectionToPopulate, javax.servlet.ServletRequest request)
@java.lang.SuppressWarningsfor (Map.Entry
public static CollectionDataBindingSource createCollectionDataBindingSource(GrailsApplication grailsApplication, java.lang.Class bindingTargetType, java.lang.Object bindingSource)
public static DataBindingSource createDataBindingSource(GrailsApplication grailsApplication, java.lang.Class bindingTargetType, java.lang.Object bindingSource)
public static DataBindingSourceRegistry getDataBindingSourceRegistry(GrailsApplication grailsApplication)
protected static java.lang.String[] getMessageCodes(java.lang.String messageCode, java.lang.Class objectType)
public static MimeType getMimeType(GrailsApplication grailsApplication, java.lang.Object bindingSource)
public static MimeTypeResolver getMimeTypeResolver(GrailsApplication grailsApplication)
public static MimeType resolveMimeType(java.lang.Object bindingSource, MimeTypeResolver mimeTypeResolver)
Groovy Documentation