Class ProxyMaps


  • public class ProxyMaps
    extends Proxies
    Utility methods used by map proxies.
    Author:
    Abe White
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  ProxyMaps.ProxyEntrySet
      Marker interface for a proxy entry set.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyMaps()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set afterEntrySet​(ProxyMap map, java.util.Set entries)
      Wrap the given entry set in a proxy.
      static java.lang.Object afterGet​(ProxyMap map, java.lang.Object key, java.lang.Object ret, boolean before)
      Call after invoking Map.get(java.lang.Object) on super.
      static java.lang.Object afterPut​(ProxyMap map, java.lang.Object key, java.lang.Object value, java.lang.Object ret, boolean before)
      Call after invoking Map.put(K, V) on super.
      static java.lang.Object afterRemove​(ProxyMap map, java.lang.Object key, java.lang.Object ret, boolean before)
      Call after invoking Map.remove(java.lang.Object) on super.
      static boolean afterRemove​(ProxyMap map, java.lang.Object key, java.lang.Object value, boolean ret, boolean before)
      See OPENJPA-2442.
      static java.lang.Object afterSetProperty​(ProxyMap map, java.lang.String key, java.lang.String value, java.lang.Object ret, boolean before)
      Call after invoking Properties.setProperty(java.lang.String, java.lang.String) on super.
      static void beforeClear​(ProxyMap map)
      Call before invoking Map.clear() on super.
      static boolean beforeGet​(ProxyMap map, java.lang.Object key)
      Call before invoking Map.get(java.lang.Object) on super.
      static void beforeLoad​(ProxyMap map, java.io.InputStream in)
      Call before invoking Properties.load(java.io.Reader) on super.
      static void beforeLoadFromXML​(ProxyMap map, java.io.InputStream in)
      Call before invoking Properties#loadXML on super.
      static boolean beforePut​(ProxyMap map, java.lang.Object key, java.lang.Object value)
      Call before invoking Map.put(K, V) on super.
      static boolean beforeRemove​(ProxyMap map, java.lang.Object key)
      Call before invoking Map.remove(java.lang.Object) on super.
      static boolean beforeRemove​(ProxyMap map, java.lang.Object key, java.lang.Object value)
      See OPENJPA-2442.
      static boolean beforeSetProperty​(ProxyMap map, java.lang.String key, java.lang.String value)
      Call before invoking Properties.setProperty(java.lang.String, java.lang.String) on super.
      static java.util.Set keySet​(ProxyMap map)
      Override for Map.keySet().
      static void putAll​(ProxyMap map, java.util.Map values)
      Overload for Map.putAll(java.util.Map<? extends K, ? extends V>).
      static java.util.Collection values​(ProxyMap map)
      Override for Map.values().
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProxyMaps

        public ProxyMaps()
    • Method Detail

      • beforeClear

        public static void beforeClear​(ProxyMap map)
        Call before invoking Map.clear() on super.
      • keySet

        public static java.util.Set keySet​(ProxyMap map)
        Override for Map.keySet().
      • values

        public static java.util.Collection values​(ProxyMap map)
        Override for Map.values().
      • afterEntrySet

        public static java.util.Set afterEntrySet​(ProxyMap map,
                                                  java.util.Set entries)
        Wrap the given entry set in a proxy.
      • beforeGet

        public static boolean beforeGet​(ProxyMap map,
                                        java.lang.Object key)
        Call before invoking Map.get(java.lang.Object) on super.
      • afterGet

        public static java.lang.Object afterGet​(ProxyMap map,
                                                java.lang.Object key,
                                                java.lang.Object ret,
                                                boolean before)
        Call after invoking Map.get(java.lang.Object) on super. The potential change is tracked when the get method is called. This change will not translated to an update statement if the retrieved value is not dirty.
        Parameters:
        ret - the return value from the super's method
        before - the return value from beforeGet(org.apache.openjpa.util.proxy.ProxyMap, java.lang.Object)
        Returns:
        the value to return from Map.get(java.lang.Object)
      • beforePut

        public static boolean beforePut​(ProxyMap map,
                                        java.lang.Object key,
                                        java.lang.Object value)
        Call before invoking Map.put(K, V) on super.
      • beforeSetProperty

        public static boolean beforeSetProperty​(ProxyMap map,
                                                java.lang.String key,
                                                java.lang.String value)
        Call before invoking Properties.setProperty(java.lang.String, java.lang.String) on super.
      • afterSetProperty

        public static java.lang.Object afterSetProperty​(ProxyMap map,
                                                        java.lang.String key,
                                                        java.lang.String value,
                                                        java.lang.Object ret,
                                                        boolean before)
        Call after invoking Properties.setProperty(java.lang.String, java.lang.String) on super.
        Parameters:
        ret - the return value from the super's method
        before - the return value from beforeSetProperty(org.apache.openjpa.util.proxy.ProxyMap, java.lang.String, java.lang.String)
        Returns:
        the value to return from Properties.setProperty(java.lang.String, java.lang.String)
      • beforeLoad

        public static void beforeLoad​(ProxyMap map,
                                      java.io.InputStream in)
        Call before invoking Properties.load(java.io.Reader) on super.
      • beforeLoadFromXML

        public static void beforeLoadFromXML​(ProxyMap map,
                                             java.io.InputStream in)
        Call before invoking Properties#loadXML on super.
      • putAll

        public static void putAll​(ProxyMap map,
                                  java.util.Map values)
        Overload for Map.putAll(java.util.Map<? extends K, ? extends V>).
      • beforeRemove

        public static boolean beforeRemove​(ProxyMap map,
                                           java.lang.Object key)
        Call before invoking Map.remove(java.lang.Object) on super.
      • afterRemove

        public static java.lang.Object afterRemove​(ProxyMap map,
                                                   java.lang.Object key,
                                                   java.lang.Object ret,
                                                   boolean before)
        Call after invoking Map.remove(java.lang.Object) on super.
        Parameters:
        ret - the return value from the super's method
        before - the return value from beforeRemove(org.apache.openjpa.util.proxy.ProxyMap, java.lang.Object)
        Returns:
        the value to return from Map.remove(java.lang.Object)
      • beforeRemove

        public static boolean beforeRemove​(ProxyMap map,
                                           java.lang.Object key,
                                           java.lang.Object value)
        See OPENJPA-2442. Call before invoking Map#remove(key, value) on super.
      • afterRemove

        public static boolean afterRemove​(ProxyMap map,
                                          java.lang.Object key,
                                          java.lang.Object value,
                                          boolean ret,
                                          boolean before)
        See OPENJPA-2442. Call after invoking Map#remove(key, value) on super.
        Parameters:
        ret - the return value from the super's method
        before - the return value from beforeRemove(org.apache.openjpa.util.proxy.ProxyMap, java.lang.Object)
        Returns:
        the value to return from Map.remove(java.lang.Object)