org.eclipse.actf.validation.javapp.aspects
Class AspectGenerator

java.lang.Object
  extended by org.eclipse.actf.validation.javapp.aspects.AspectGenerator

public class AspectGenerator
extends Object


Field Summary
static String indent
           
 
Constructor Summary
AspectGenerator()
           
 
Method Summary
 void addClassMember(String modifier, String type, String name, String initialValue)
           
 void addImport(String packageName)
           
 void addImports(Vector imports)
           
 void compileAspectFile(String workingDir, File file)
           
 void createAdvice(String type, String parameterList, String pointcutExpression, String body, String afterAction)
          generate advice for pointcuts an advice takes form of: type (parameterList) [returning/throwing(formal)] : pointcutExpression { body };
 void createAspect(String packageName, String aspectName, String superClass)
           
 void createPointcut(String name, String parameterList, String expression)
          generate pointcut.
 File generateAspectFile(String workingDir, String aspectName)
          Create a aspect source file in system's temp directory or specified trace directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indent

public static final String indent
See Also:
Constant Field Values
Constructor Detail

AspectGenerator

public AspectGenerator()
Method Detail

createAspect

public void createAspect(String packageName,
                         String aspectName,
                         String superClass)
                  throws ValidationProcessException
Parameters:
packageName: - package name of the aspect class to be generated
aspectName: -
superClass: - should be InterJvmValidationAspect for Inter-JVM validation, and IntraJvmValidation for inter-JVm validation
Throws:
ValidationProcessException

addImports

public void addImports(Vector imports)
                throws ValidationProcessException
Throws:
ValidationProcessException

addImport

public void addImport(String packageName)
               throws ValidationProcessException
Throws:
ValidationProcessException

addClassMember

public void addClassMember(String modifier,
                           String type,
                           String name,
                           String initialValue)
                    throws ValidationProcessException
Throws:
ValidationProcessException

createPointcut

public void createPointcut(String name,
                           String parameterList,
                           String expression)
                    throws ValidationProcessException
generate pointcut. Assume all the parameter passed are valid a pointcut takes the form of: pointcut name(parameterList) : expression;

Parameters:
name: - pointcut name, optional
parameterList: - optional, a comma-separated type-parameter pairs same with parameter list in a java method
expression: - required
Throws:
ValidationProcessException

createAdvice

public void createAdvice(String type,
                         String parameterList,
                         String pointcutExpression,
                         String body,
                         String afterAction)
                  throws ValidationProcessException
generate advice for pointcuts an advice takes form of: type (parameterList) [returning/throwing(formal)] : pointcutExpression { body };

Parameters:
type: - required, one of the before, after and around
parameterList: - optional, a comma-separated type-parameter pairs same with parameter list in a java method
pointcutExpression: - optional, pointcut name and parameterlist, can be combined using &&, !, || etc.
body: - required, advice body
afterAction: - one of the throwing(formal) or returning(formal). required only if the advice type is after
Throws:
ValidationProcessException

generateAspectFile

public File generateAspectFile(String workingDir,
                               String aspectName)
                        throws IOException
Create a aspect source file in system's temp directory or specified trace directory

Parameters:
path -
Returns:
Throws:
IOException

compileAspectFile

public void compileAspectFile(String workingDir,
                              File file)