org.eclipse.actf.validation.javapp.aspects
Class AspectGenerator
java.lang.Object
org.eclipse.actf.validation.javapp.aspects.AspectGenerator
public class AspectGenerator
- extends Object
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 |
indent
public static final String indent
- See Also:
- Constant Field Values
AspectGenerator
public AspectGenerator()
createAspect
public void createAspect(String packageName,
String aspectName,
String superClass)
throws ValidationProcessException
- Parameters:
packageName:
- package name of the aspect class to be generatedaspectName:
- 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, optionalparameterList:
- optional, a comma-separated type-parameter pairs same with parameter list in a java methodexpression:
- 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 aroundparameterList:
- optional, a comma-separated type-parameter pairs same with parameter list in a java methodpointcutExpression:
- optional, pointcut name and parameterlist, can be combined using &&, !, || etc.body:
- required, advice bodyafterAction:
- 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)