@java.lang.SuppressWarnings("rawtypes") public class DataBindingUtils extends java.lang.Object
Utility methods to perform data binding from Grails objects.
Modifiers | Name | Description |
---|---|---|
private static java.lang.String |
BLANK |
|
private static java.util.Map<java.lang.Class, java.util.List> |
CLASS_TO_BINDING_INCLUDE_LIST |
|
static java.lang.String |
DATA_BINDER_BEAN_NAME |
Type Params | Return Type | Name and description |
---|---|---|
|
public static void |
assignBidirectionalAssociations(java.lang.Object object, java.util.Map source, org.grails.datastore.mapping.model.PersistentEntity persistentEntity) Associations both sides of any bidirectional relationships found in the object and source map to bind |
|
public static org.springframework.validation.BindingResult |
bindObjectToDomainInstance(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.Object object, java.lang.Object source) Binds the given source object to the given target object performing type conversion if necessary |
|
public static org.springframework.validation.BindingResult |
bindObjectToDomainInstance(org.grails.datastore.mapping.model.PersistentEntity entity, 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 |
|
public 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 |
|
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) Binds the given source object to the given target object performing type conversion if necessary |
<T> |
public static void |
bindToCollection(java.lang.Class<T> targetType, java.util.Collection<T> 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 |
<T> |
public static void |
bindToCollection(java.lang.Class<T> targetType, java.util.Collection<T> collectionToPopulate, javax.servlet.ServletRequest request) |
|
public static java.util.Map |
convertPotentialGStrings(java.util.Map<java.lang.Object, java.lang.Object> args) |
|
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) |
|
protected static java.util.List |
getBindingIncludeList(java.lang.Object object) |
|
public static DataBindingSourceRegistry |
getDataBindingSourceRegistry(GrailsApplication grailsApplication) |
|
private static DataBinder |
getGrailsWebDataBinder(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) |
|
private static java.lang.Object |
unwrapGString(java.lang.Object value) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), 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() |
Associations both sides of any bidirectional relationships found in the object and source map to bind
object
- The objectsource
- The source mappersistentEntity
- The PersistentEntity for the objectBinds the given source object to the given target object performing type conversion if necessary
entity
- The PersistentEntity instanceobject
- The object to bind tosource
- The source objectBinds the given source object to the given target object performing type conversion if necessary
entity
- The PersistentEntity instanceobject
- The object to bind tosource
- The source objectinclude
- The list of properties to includeexclude
- The list of properties to excludefilter
- The prefix to filter byBinds the given source object to the given target object performing type conversion if necessary
object
- The object to bind tosource
- The source objectBinds the given source object to the given target object performing type conversion if necessary
object
- The object to bind tosource
- The source objectinclude
- The list of properties to includeexclude
- The list of properties to excludefilter
- The prefix to filter byFor 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
targetType
- The type of objects to create, must be a concrete classcollectionToPopulate
- A collection to populate with new instances of targetTypecollectionBindingSource
- A CollectionDataBindingSource