Package org.apache.openjpa.util.proxy
Class ProxyMaps
- java.lang.Object
-
- org.apache.openjpa.util.Proxies
-
- org.apache.openjpa.util.proxy.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 interfaceProxyMaps.ProxyEntrySetMarker 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.SetafterEntrySet(ProxyMap map, java.util.Set entries)Wrap the given entry set in a proxy.static java.lang.ObjectafterGet(ProxyMap map, java.lang.Object key, java.lang.Object ret, boolean before)Call after invokingMap.get(java.lang.Object)on super.static java.lang.ObjectafterPut(ProxyMap map, java.lang.Object key, java.lang.Object value, java.lang.Object ret, boolean before)Call after invokingMap.put(K, V)on super.static java.lang.ObjectafterRemove(ProxyMap map, java.lang.Object key, java.lang.Object ret, boolean before)Call after invokingMap.remove(java.lang.Object)on super.static booleanafterRemove(ProxyMap map, java.lang.Object key, java.lang.Object value, boolean ret, boolean before)See OPENJPA-2442.static java.lang.ObjectafterSetProperty(ProxyMap map, java.lang.String key, java.lang.String value, java.lang.Object ret, boolean before)Call after invokingProperties.setProperty(java.lang.String, java.lang.String)on super.static voidbeforeClear(ProxyMap map)Call before invokingMap.clear()on super.static booleanbeforeGet(ProxyMap map, java.lang.Object key)Call before invokingMap.get(java.lang.Object)on super.static voidbeforeLoad(ProxyMap map, java.io.InputStream in)Call before invokingProperties.load(java.io.Reader)on super.static voidbeforeLoadFromXML(ProxyMap map, java.io.InputStream in)Call before invokingProperties#loadXMLon super.static booleanbeforePut(ProxyMap map, java.lang.Object key, java.lang.Object value)Call before invokingMap.put(K, V)on super.static booleanbeforeRemove(ProxyMap map, java.lang.Object key)Call before invokingMap.remove(java.lang.Object)on super.static booleanbeforeRemove(ProxyMap map, java.lang.Object key, java.lang.Object value)See OPENJPA-2442.static booleanbeforeSetProperty(ProxyMap map, java.lang.String key, java.lang.String value)Call before invokingProperties.setProperty(java.lang.String, java.lang.String)on super.static java.util.SetkeySet(ProxyMap map)Override forMap.keySet().static voidputAll(ProxyMap map, java.util.Map values)Overload forMap.putAll(java.util.Map<? extends K, ? extends V>).static java.util.Collectionvalues(ProxyMap map)Override forMap.values().-
Methods inherited from class org.apache.openjpa.util.Proxies
assertAllowedType, dirty, isOwner, removed, writeReplace
-
-
-
-
Method Detail
-
beforeClear
public static void beforeClear(ProxyMap map)
Call before invokingMap.clear()on super.
-
keySet
public static java.util.Set keySet(ProxyMap map)
Override forMap.keySet().
-
values
public static java.util.Collection values(ProxyMap map)
Override forMap.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 invokingMap.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 invokingMap.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 methodbefore- the return value frombeforeGet(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 invokingMap.put(K, V)on super.
-
afterPut
public static java.lang.Object afterPut(ProxyMap map, java.lang.Object key, java.lang.Object value, java.lang.Object ret, boolean before)
Call after invokingMap.put(K, V)on super.- Parameters:
ret- the return value from the super's methodbefore- the return value frombeforePut(org.apache.openjpa.util.proxy.ProxyMap, java.lang.Object, java.lang.Object)- Returns:
- the value to return from
Map.put(K, V)
-
beforeSetProperty
public static boolean beforeSetProperty(ProxyMap map, java.lang.String key, java.lang.String value)
Call before invokingProperties.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 invokingProperties.setProperty(java.lang.String, java.lang.String)on super.- Parameters:
ret- the return value from the super's methodbefore- the return value frombeforeSetProperty(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 invokingProperties.load(java.io.Reader)on super.
-
beforeLoadFromXML
public static void beforeLoadFromXML(ProxyMap map, java.io.InputStream in)
Call before invokingProperties#loadXMLon super.
-
putAll
public static void putAll(ProxyMap map, java.util.Map values)
Overload forMap.putAll(java.util.Map<? extends K, ? extends V>).
-
beforeRemove
public static boolean beforeRemove(ProxyMap map, java.lang.Object key)
Call before invokingMap.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 invokingMap.remove(java.lang.Object)on super.- Parameters:
ret- the return value from the super's methodbefore- the return value frombeforeRemove(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 invokingMap#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 invokingMap#remove(key, value)on super.- Parameters:
ret- the return value from the super's methodbefore- the return value frombeforeRemove(org.apache.openjpa.util.proxy.ProxyMap, java.lang.Object)- Returns:
- the value to return from
Map.remove(java.lang.Object)
-
-