org.apache.openjpa.util
Class Proxies

java.lang.Object
  extended by org.apache.openjpa.util.Proxies

public class Proxies
extends Object

Utility methods for managing proxies.

Author:
Abe White

Field Summary
static int MODE_ENTRY
           
static int MODE_KEY
           
static int MODE_VALUE
           
 
Constructor Summary
Proxies()
           
 
Method Summary
static void assertAllowedType(Object value, Class allowed)
          Used by proxy types to check that an attempt to add a new value is legal.
static void dirty(Proxy proxy)
          Used by proxy types to dirty their owner.
static Set entrySet(ProxyMap proxy, Set set, int mode)
          Return a proxy for the given map key or entry set.
static boolean isOwner(Proxy proxy, OpenJPAStateManager sm, int field)
          Used by proxy types to check if the given owners and field names are equivalent.
static Iterator iterator(ProxyCollection proxy, Iterator itr)
          Return an iterator that dirties its owner on calls to remove.
static ListIterator listIterator(ProxyCollection proxy, ListIterator itr, Class allowed)
          Return a proxy iterator that dirties its owner on remove, set, and add.
static void removed(Proxy proxy, Object removed, boolean key)
          Used by proxy types to notify their owner that an element has been removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_ENTRY

public static final int MODE_ENTRY
See Also:
Constant Field Values

MODE_KEY

public static final int MODE_KEY
See Also:
Constant Field Values

MODE_VALUE

public static final int MODE_VALUE
See Also:
Constant Field Values
Constructor Detail

Proxies

public Proxies()
Method Detail

isOwner

public static boolean isOwner(Proxy proxy,
                              OpenJPAStateManager sm,
                              int field)
Used by proxy types to check if the given owners and field names are equivalent.


assertAllowedType

public static void assertAllowedType(Object value,
                                     Class allowed)
Used by proxy types to check that an attempt to add a new value is legal.


dirty

public static void dirty(Proxy proxy)
Used by proxy types to dirty their owner.


removed

public static void removed(Proxy proxy,
                           Object removed,
                           boolean key)
Used by proxy types to notify their owner that an element has been removed.


iterator

public static Iterator iterator(ProxyCollection proxy,
                                Iterator itr)
Return an iterator that dirties its owner on calls to remove. This iterator assumes that the given proxy collection uses a CollectionChangeTracker.


listIterator

public static ListIterator listIterator(ProxyCollection proxy,
                                        ListIterator itr,
                                        Class allowed)
Return a proxy iterator that dirties its owner on remove, set, and add. This iterator assumes that the given proxy collection uses a CollectionChangeTracker.


entrySet

public static Set entrySet(ProxyMap proxy,
                           Set set,
                           int mode)
Return a proxy for the given map key or entry set.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.