com.sun.xml.bind
Class ProxyGroup

java.lang.Object
  extended by com.sun.xml.bind.ProxyGroup

public class ProxyGroup
extends java.lang.Object

Bridges two isomorphic interface sets in different packages.

Even though we officially require JDK1.3 or higher, feedback shows that there are a lot of people out there who are stuck with JDK 1.2. But in JDK1.2, the Proxy class is not available.

This class is carefully crafted so that it tries to work with JDK1.2 as much as possible (with certain limitation.)

Since:
1.0.1

Method Summary
static java.lang.Object blindWrap(java.lang.Object o, java.lang.Class mask, java.lang.Class[] maskSatellite)
          Wraps an unknown object into a given "mask" and return it.
static java.lang.Object unwrap(java.lang.Object o)
           
static java.lang.Object wrap(java.lang.Object gi, java.lang.Class giClass, java.lang.Class[] neighbors)
          Initialize the ProxyGroup for the JAXB generated runtime classes that might require proxies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

wrap

public static java.lang.Object wrap(java.lang.Object gi,
                                    java.lang.Class giClass,
                                    java.lang.Class[] neighbors)
Initialize the ProxyGroup for the JAXB generated runtime classes that might require proxies. The ordering of the tuples is important. To setup bidirectional proxies for org.a.Foo and org.b.Foo you should pass in: new Class[] { org.a.Foo.class, org.b.Foo.class }

Parameters:
neighbors - ordered tuples of Class objects that might require proxies.
Returns:
the proxy object for GrammarInfo since it is the root of the runtime classes needed to start unmarshalling

blindWrap

public static java.lang.Object blindWrap(java.lang.Object o,
                                         java.lang.Class mask,
                                         java.lang.Class[] maskSatellite)
Wraps an unknown object into a given "mask" and return it. This method will dynamically determine the face type and generates proxies if necessary.

Parameters:
o - An object to be wrapped.
mask - The interface class of the proxy to be returned.
maskSatellite - Other relevant interfaces on the mask side that may need proxies.
Returns:
null if something goes wrong, or an instance of the mask class that wraps the given 'o'.

unwrap

public static java.lang.Object unwrap(java.lang.Object o)