com.infomancers.collections.yield.asm
Class YielderTransformer

java.lang.Object
  extended by com.infomancers.collections.yield.asm.YielderTransformer
All Implemented Interfaces:
java.lang.instrument.ClassFileTransformer

public final class YielderTransformer
extends java.lang.Object
implements java.lang.instrument.ClassFileTransformer

A class transformation file which creates three chains of ASM visitors, all three eventually create the enhanced class which keeps state and supports the yield idea.

The chains are:

1. reader (of origin) -> returnCounter -> assignMapper -> null 2. reader (of origin) -> promoter -> stateKeeper (using returnCounter) -> writer (to output1) 3. reader (of output1) -> assigner (using promoter) -> writer (to output2)

And then returns output2.

Also, notice that the order of the visitors is important: The promoter counts on the labels to be in the exact same order as the assignMapper sees them.


Constructor Summary
YielderTransformer(boolean debug)
           
 
Method Summary
 byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YielderTransformer

public YielderTransformer(boolean debug)
Method Detail

transform

public byte[] transform(java.lang.ClassLoader loader,
                        java.lang.String className,
                        java.lang.Class<?> classBeingRedefined,
                        java.security.ProtectionDomain protectionDomain,
                        byte[] classfileBuffer)
                 throws java.lang.instrument.IllegalClassFormatException
Specified by:
transform in interface java.lang.instrument.ClassFileTransformer
Throws:
java.lang.instrument.IllegalClassFormatException