org.fuin.srcgen4javassist.factory
Class ImplementationFactory

java.lang.Object
  extended by org.fuin.srcgen4javassist.factory.ImplementationFactory

public class ImplementationFactory
extends Object

Creates an implementation of an interface.


Constructor Summary
ImplementationFactory(SgClassPool pool)
          Constructor with class pool.
ImplementationFactory(SgClassPool pool, boolean onlyDeclaredMethods)
          Constructor with class pool and information about methods to implement.
 
Method Summary
 SgClass create(String implPackageName, String implClassName, ImplementationFactoryListener listener, Class<?>... intf)
          Creates an implementation of the interface.
 SgClass create(String implPackageName, String implClassName, SgClass superClass, SgClass enclosingClass, ImplementationFactoryListener listener, Class<?>... intf)
          Creates an implementation of the interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplementationFactory

public ImplementationFactory(SgClassPool pool)
Constructor with class pool. All methods will be implemented (declared and super interface methods). If you just want to implement declared methods use the ImplementationFactory(SgClassPool, boolean) constructor.

Parameters:
pool - Class pool.

ImplementationFactory

public ImplementationFactory(SgClassPool pool,
                             boolean onlyDeclaredMethods)
Constructor with class pool and information about methods to implement.

Parameters:
pool - Class pool.
onlyDeclaredMethods - Should only declared methods be implemented?
Method Detail

create

public final SgClass create(String implPackageName,
                            String implClassName,
                            ImplementationFactoryListener listener,
                            Class<?>... intf)
Creates an implementation of the interface.

Parameters:
implPackageName - Name of the implementation package - Cannot be null.
implClassName - Name of the implementation class - Cannot be null.
listener - Creates the bodies for all methods - Cannot be null.
intf - One or more interfaces.
Returns:
New object implementing the interface.

create

public final SgClass create(String implPackageName,
                            String implClassName,
                            SgClass superClass,
                            SgClass enclosingClass,
                            ImplementationFactoryListener listener,
                            Class<?>... intf)
Creates an implementation of the interface.

Parameters:
implPackageName - Name of the implementation package - Cannot be null.
implClassName - Name of the implementation class - Cannot be null.
superClass - Parent class or null.
enclosingClass - Outer class or null.
listener - Creates the bodies for all methods - Cannot be null.
intf - One or more interfaces.
Returns:
New object implementing the interface.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.