org.springframework.validation.support

Class BindingAwareModelMap

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, Model


    public class BindingAwareModelMap
    extends ExtendedModelMap
    Subclass of ExtendedModelMap that automatically removes a BindingResult object if the corresponding target attribute gets replaced through regular Map operations.

    This is the class exposed to handler methods by Spring MVC, typically consumed through a declaration of the Model interface. There is no need to build it within user code; a plain ModelMap or even a just a regular Map with String keys will be good enough to return a user model.

    Since:
    2.5.6
    Author:
    Juergen Hoeller
    See Also:
    BindingResult, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object put(java.lang.String key, java.lang.Object value) 
      void putAll(java.util.Map<? extends java.lang.String,?> map) 
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
    • Constructor Detail

      • BindingAwareModelMap

        public BindingAwareModelMap()
    • Method Detail

      • put

        public java.lang.Object put(java.lang.String key,
                                    java.lang.Object value)
        Specified by:
        put in interface java.util.Map<java.lang.String,java.lang.Object>
        Overrides:
        put in class java.util.HashMap<java.lang.String,java.lang.Object>
      • putAll

        public void putAll(java.util.Map<? extends java.lang.String,?> map)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,java.lang.Object>
        Overrides:
        putAll in class java.util.HashMap<java.lang.String,java.lang.Object>