net.spy.util
Class ProxyInterfaceImplementor

java.lang.Object
  extended bynet.spy.SpyObject
      extended bynet.spy.util.InterfaceImplementor
          extended bynet.spy.util.ProxyInterfaceImplementor

public class ProxyInterfaceImplementor
extends InterfaceImplementor

Create static proxy implementations of interfaces. This class is similiar to InterfaceImplementor, except it's used to create static proxy interface implementations which may be extended to override specific functionality (otherwise, the proxy would be kind of worthless, wouldn't it?).


Constructor Summary
ProxyInterfaceImplementor(Class c)
          Get an instance of ProxyInterfaceImplementor.
 
Method Summary
protected  boolean buildConstructors()
          Don't create the default constructors.
protected  String implement(Method method)
          Implement this method as a proxy wrapper around the contained object.
static void main(String[] args)
          Create a proxy class for the specified interface.
protected  String preConstructors()
          Create the instance variables and constructor for the proxy.
protected  String preMethods()
          Before the generated methods, include methods for accessing and setting the proxied object.
 
Methods inherited from class net.spy.util.InterfaceImplementor
getDocLink, getDocLink, getInterface, getOutClassName, getOutPackageName, getSignature, getSignature, getSuperclass, makeSource, setOutputClass, setSuperClass, writeSourceToFile
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyInterfaceImplementor

public ProxyInterfaceImplementor(Class c)
Get an instance of ProxyInterfaceImplementor.

Parameters:
c - the interface to be implemented
Throws:
NullPointerException - if the passed in class is null
IllegalArgumentException - if the passed in class is not an interface
Method Detail

buildConstructors

protected boolean buildConstructors()
Don't create the default constructors.

Overrides:
buildConstructors in class InterfaceImplementor

preConstructors

protected String preConstructors()
Create the instance variables and constructor for the proxy.

Overrides:
preConstructors in class InterfaceImplementor

preMethods

protected String preMethods()
Before the generated methods, include methods for accessing and setting the proxied object.

Overrides:
preMethods in class InterfaceImplementor

implement

protected String implement(Method method)
Implement this method as a proxy wrapper around the contained object.

Overrides:
implement in class InterfaceImplementor
Parameters:
method - the method to implement
Returns:
the text required to implement this method

main

public static void main(String[] args)
                 throws Exception
Create a proxy class for the specified interface.

Throws:
Exception