org.objectweb.fractal.juliak.asm
Class AbstractClassGenerator

java.lang.Object
  extended by org.objectweb.fractal.juliak.asm.AbstractClassGenerator
All Implemented Interfaces:
ClassGenerator
Direct Known Subclasses:
CloneableAttributeControllerClassGenerator, InterceptorClassGenerator, InterfaceClassGenerator

public abstract class AbstractClassGenerator
extends Object
implements ClassGenerator

Root class for InterfaceType-based class generators.

Since:
2.5
Author:
Lionel Seinturier

Constructor Summary
AbstractClassGenerator()
           
 
Method Summary
 Class generate(InterfaceType it, InitializationContext ic)
          Generate a class implementing the given Fractal interface type.
abstract  byte[] generate(String targetClassname, InterfaceType it, InitializationContext ic)
          Generate the bytecode of a class implementing the given Fractal interface type.
protected  ClassLoader getClassLoader()
           
protected abstract  String getClassNameSuffix(InterfaceType it)
          Return the name of the suffix which is appended to generated class names.
protected  Loader getLoader()
           
 String getTargetClassName(InterfaceType it)
          Return the name of the class generated by the current class generator for the specified interface type.
abstract  boolean match(InterfaceType it)
          Return true if the mode (IN, OUT or IN_OUT) of the class generator matchs the mode (client or server) of the given interface type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractClassGenerator

public AbstractClassGenerator()
Method Detail

getClassNameSuffix

protected abstract String getClassNameSuffix(InterfaceType it)
Return the name of the suffix which is appended to generated class names.


match

public abstract boolean match(InterfaceType it)
Return true if the mode (IN, OUT or IN_OUT) of the class generator matchs the mode (client or server) of the given interface type.

Specified by:
match in interface ClassGenerator

generate

public abstract byte[] generate(String targetClassname,
                                InterfaceType it,
                                InitializationContext ic)
                         throws InstantiationException
Generate the bytecode of a class implementing the given Fractal interface type.

Specified by:
generate in interface ClassGenerator
Parameters:
targetClassname - the name of the class to generate
it - the corresponding interface type
ic - the context for initializing the generated class
Returns:
the bytecode of the generated class
Throws:
InstantiationException

generate

public Class generate(InterfaceType it,
                      InitializationContext ic)
               throws InstantiationException
Generate a class implementing the given Fractal interface type.

Specified by:
generate in interface ClassGenerator
Parameters:
it - the interface type
ic - the context for initializing the generated class
Returns:
a class implementing the given Fractal interface type
Throws:
InstantiationException

getTargetClassName

public String getTargetClassName(InterfaceType it)
Return the name of the class generated by the current class generator for the specified interface type.

Specified by:
getTargetClassName in interface ClassGenerator

getLoader

protected Loader getLoader()

getClassLoader

protected ClassLoader getClassLoader()