org.objectweb.dsrg.sofa.bootstrap
Class InterceptorGeneratorHelper

java.lang.Object
  extended by org.objectweb.dsrg.sofa.bootstrap.InterceptorGeneratorHelper

public class InterceptorGeneratorHelper
extends java.lang.Object

Support class for dumping outputs of InterceptorGenerator to file.

See Also:
InterceptorGenerator

Field Summary
static java.lang.String DEFAULT_SAVE_LOCATION
           
static java.lang.String SAVE_GENERATED_INTERCEPTORS_OPTION
          Name of system property which cause saving of generated interceptors to files Property can contain values: class|bytecode|both
static java.lang.String SAVE_LOCATION_INTERCEPTORS_OPTION
          Location where generated files are stored.
 
Constructor Summary
InterceptorGeneratorHelper()
           
 
Method Summary
static void dumpClass(java.io.File outputFile, org.objectweb.asm.ClassWriter cw)
          Dump given class bytecode into a java file.
static void dumpClass(java.lang.String className, org.objectweb.asm.ClassWriter cw)
          Dump given class represented by ClassWriter to java file and to class file.
static void saveClass(java.io.File outputFile, org.objectweb.asm.ClassWriter cw)
          Save given class to a file.
static boolean saveInterceptors()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_GENERATED_INTERCEPTORS_OPTION

public static final java.lang.String SAVE_GENERATED_INTERCEPTORS_OPTION
Name of system property which cause saving of generated interceptors to files Property can contain values: class|bytecode|both. - class: only binary byte code is saved - bytecode: only textual representation of bytecode is saved - both: both representation are stored

See Also:
Constant Field Values

SAVE_LOCATION_INTERCEPTORS_OPTION

public static final java.lang.String SAVE_LOCATION_INTERCEPTORS_OPTION
Location where generated files are stored.

See Also:
Constant Field Values

DEFAULT_SAVE_LOCATION

public static final java.lang.String DEFAULT_SAVE_LOCATION
See Also:
Constant Field Values
Constructor Detail

InterceptorGeneratorHelper

public InterceptorGeneratorHelper()
Method Detail

dumpClass

public static void dumpClass(java.lang.String className,
                             org.objectweb.asm.ClassWriter cw)
Dump given class represented by ClassWriter to java file and to class file. Location, where the file are stored, is saved in system property
sofa.interceptors.save.location
.

Parameters:
className - name of class
cw - representation of class

dumpClass

public static void dumpClass(java.io.File outputFile,
                             org.objectweb.asm.ClassWriter cw)
                      throws java.io.FileNotFoundException
Dump given class bytecode into a java file.

Parameters:
outputFile - output java file
cw - representation of class
Throws:
java.io.FileNotFoundException

saveClass

public static void saveClass(java.io.File outputFile,
                             org.objectweb.asm.ClassWriter cw)
                      throws java.io.IOException
Save given class to a file.

Parameters:
outputFile - output class file
cw - representation of class
Throws:
java.io.IOException

saveInterceptors

public static boolean saveInterceptors()