Top Description Constructors Methods
org.springframework.validation

public abstract Class BindingResultUtils

extends Object
Class Inheritance
Imports
java.util.Map, org.springframework.lang.Nullable, org.springframework.util.Assert

Convenience methods for looking up BindingResults in a model Map.
Author
Juergen Hoeller
Since
2.0
See Also
BindingResult#MODEL_KEY_PREFIX

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static BindingResult

Returns:

the BindingResult, or null if none found
getBindingResult
(Map<?, ?>
the model to search
model
,
String
the name of the target object to find a BindingResult for
name
)

Find the BindingResult for the given name in the given model.

public static BindingResult

Returns:

the BindingResult (never null)
getRequiredBindingResult
(Map<?, ?>
the model to search
model
,
String
the name of the target object to find a BindingResult for
name
)

Find a required BindingResult for the given name in the given model.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BindingResultUtilsback to summary
public BindingResultUtils()

Method Detail

getBindingResultback to summary
public static BindingResult getBindingResult(Map<?, ?> model, String name)

Find the BindingResult for the given name in the given model.

Parameters
model:Map<?, ?>

the model to search

name:String

the name of the target object to find a BindingResult for

Returns:BindingResult

the BindingResult, or null if none found

Annotations
@Nullable
Exceptions
IllegalStateException:
if the attribute found is not of type BindingResult
getRequiredBindingResultback to summary
public static BindingResult getRequiredBindingResult(Map<?, ?> model, String name)

Find a required BindingResult for the given name in the given model.

Parameters
model:Map<?, ?>

the model to search

name:String

the name of the target object to find a BindingResult for

Returns:BindingResult

the BindingResult (never null)

Exceptions
IllegalStateException:
if no BindingResult found