Class MapProxy<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Map<K,​V>, javassist.util.proxy.Proxy, FormProxyObject

    public class MapProxy<K,​V>
    extends java.lang.Object
    implements java.util.Map<K,​V>, javassist.util.proxy.Proxy, FormProxyObject, java.io.Serializable
    A proxy object to implement Map
    Since:
    8.0.0
    Author:
    jumperchen
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      MapProxy​(java.util.Map<K,​V> origin, java.lang.annotation.Annotation[] callerAnnots)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cacheSavePropertyBinding​(java.lang.String property, SavePropertyBinding s)
      Cache save property binding by property string
      void clear()  
      java.util.Set<Pair<java.lang.String,​SavePropertyBinding>> collectCachedSavePropertyBinding()
      Collect all of collect cached save property bindings
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()  
      V get​(java.lang.Object key)  
      java.lang.Object getOriginObject()
      Returns the origin object.
      boolean isEmpty()  
      boolean isFormDirty()
      Returns whether the form proxy object is dirty or not, including all of its attributes.
      java.util.Set<K> keySet()  
      void onDataChange​(java.lang.Object o)  
      void onDirtyChange()  
      V put​(K key, V value)  
      void putAll​(java.util.Map<? extends K,​? extends V> m)  
      V remove​(java.lang.Object key)  
      protected java.lang.Object replaceOrigin​(java.lang.Object origin)  
      void resetFromOrigin()
      Resets all of the changes of this form from the origin object.
      protected void setDirty​(boolean d)  
      void setFormOwner​(java.lang.Object owner, FormBinding binding)
      Sets the owner of this form with its binding.
      void setHandler​(javassist.util.proxy.MethodHandler mi)  
      void setPath​(java.lang.String property, ProxyNode parent)
      Set the property of current form proxy object and it's creator
      int size()  
      void submitToOrigin​(BindContext ctx)
      Saves all of the changes of this form to the origin object.
      java.util.Collection<V> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • MapProxy

        public MapProxy​(java.util.Map<K,​V> origin,
                        java.lang.annotation.Annotation[] callerAnnots)
    • Method Detail

      • replaceOrigin

        protected java.lang.Object replaceOrigin​(java.lang.Object origin)
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>
      • resetFromOrigin

        public void resetFromOrigin()
        Description copied from interface: FormProxyObject
        Resets all of the changes of this form from the origin object.
        Specified by:
        resetFromOrigin in interface FormProxyObject
      • onDirtyChange

        public void onDirtyChange()
      • onDataChange

        public void onDataChange​(java.lang.Object o)
      • setDirty

        protected void setDirty​(boolean d)
      • isFormDirty

        public boolean isFormDirty()
        Description copied from interface: FormProxyObject
        Returns whether the form proxy object is dirty or not, including all of its attributes.
        Specified by:
        isFormDirty in interface FormProxyObject
      • setHandler

        public void setHandler​(javassist.util.proxy.MethodHandler mi)
        Specified by:
        setHandler in interface javassist.util.proxy.Proxy
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<K,​V>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K,​V>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<K,​V>
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K,​V>
      • putAll

        public void putAll​(java.util.Map<? extends K,​? extends V> m)
        Specified by:
        putAll in interface java.util.Map<K,​V>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<K,​V>
      • keySet

        public java.util.Set<K> keySet()
        Specified by:
        keySet in interface java.util.Map<K,​V>
      • values

        public java.util.Collection<V> values()
        Specified by:
        values in interface java.util.Map<K,​V>
      • setFormOwner

        public void setFormOwner​(java.lang.Object owner,
                                 FormBinding binding)
        Description copied from interface: FormProxyObject
        Sets the owner of this form with its binding.
        Specified by:
        setFormOwner in interface FormProxyObject
        Parameters:
        owner - the object associated with this form.
      • cacheSavePropertyBinding

        public void cacheSavePropertyBinding​(java.lang.String property,
                                             SavePropertyBinding s)
        Description copied from interface: FormProxyObject
        Cache save property binding by property string
        Specified by:
        cacheSavePropertyBinding in interface FormProxyObject
        Parameters:
        property - the property of save property binding
        s - the save property binding
      • setPath

        public void setPath​(java.lang.String property,
                            ProxyNode parent)
        Description copied from interface: FormProxyObject
        Set the property of current form proxy object and it's creator
        Specified by:
        setPath in interface FormProxyObject
        Parameters:
        property - p the property
        parent - parent the parent proxy node