ataspectj
Class AspectUpdater

java.lang.Object
  extended by ataspectj.AtAspectjComponent
      extended by ataspectj.AspectUpdater

public class AspectUpdater
extends AtAspectjComponent

Class used to translate the @expr e @block pointcut into AspectJ valid pointcut.


Field Summary
 java.lang.String[] _ajToUpdate
          The list of aj file to check.
 int _mode
          The exec mode of the class.
static java.lang.String BLOCKPATTERN
          The string patter of the pointcut @block.
static java.lang.String EXPRPATTERN
          The string patter of the pointcut @expr.
static int NOMODE
          No mode selected
static int RESTORE
          The command to exec.
static java.lang.String RESTOREOPT
          The -restore option used to restore the original aj source
static int TOATASPECTJ
          The command to exec.
static java.lang.String TOATASPECTJOPT
          The -ataspectj option used to translate the new poincut
 
Fields inherited from class ataspectj.AtAspectjComponent
barrier, CODEPRINT, DEBUG, VERBOSE
 
Constructor Summary
AspectUpdater(java.lang.String[] args)
          The standard constructor of the class.
 
Method Summary
 void backupAjs()
          Method used to backup the original aj files.
static boolean checkAnnotation(java.lang.String a, java.lang.String b)
          Used to check if the wrapperExpressionAnnotation parameters contains the specified annotation name.
 void copy(java.io.File src, java.io.File dst)
          It copies the file src to the file dst
 int doJob()
          Method used to do the job.
static java.lang.String getAnnotationName(java.lang.String s)
          Retrieve from a @expr or @block pointcut the annotation name.
static void main(java.lang.String[] args)
          Main used to test the class.
 void parseArgs(java.lang.String[] args)
          Method used to parse the arguments
 void restoreAJs()
          Method used to restore the original .aj files.
static int start(java.lang.String[] args)
          It starts the job depending of the exec mode specified into args.
 void updateAJs()
          Method used to translate aj from @AspectJ to AspectJ
 int updateBlockAnnotation(java.lang.String ajFileName)
          It updates the @block pointcut.
 int updateExpressionAspect(java.lang.String ajFileName)
          It updates the @expr pointcut.
 
Methods inherited from class ataspectj.AtAspectjComponent
done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPRPATTERN

public static final java.lang.String EXPRPATTERN
The string patter of the pointcut @expr.

See Also:
Constant Field Values

BLOCKPATTERN

public static final java.lang.String BLOCKPATTERN
The string patter of the pointcut @block.

See Also:
Constant Field Values

RESTOREOPT

public static final java.lang.String RESTOREOPT
The -restore option used to restore the original aj source

See Also:
Constant Field Values

TOATASPECTJOPT

public static final java.lang.String TOATASPECTJOPT
The -ataspectj option used to translate the new poincut

See Also:
Constant Field Values

TOATASPECTJ

public static final int TOATASPECTJ
The command to exec. With this option the class translate the new pointcut.

See Also:
Constant Field Values

RESTORE

public static final int RESTORE
The command to exec. With this option the class restore the original files.

See Also:
Constant Field Values

NOMODE

public static final int NOMODE
No mode selected

See Also:
Constant Field Values

_ajToUpdate

public java.lang.String[] _ajToUpdate
The list of aj file to check.


_mode

public int _mode
The exec mode of the class. Default is no mode.

Constructor Detail

AspectUpdater

public AspectUpdater(java.lang.String[] args)
The standard constructor of the class. It takes the parameter.

Parameters:
args - the parameters of execution.
Method Detail

doJob

public int doJob()
Method used to do the job. It depends of the exec mode.


updateAJs

public void updateAJs()
               throws java.lang.Exception
Method used to translate aj from @AspectJ to AspectJ

Throws:
java.lang.Exception

restoreAJs

public void restoreAJs()
                throws java.io.IOException
Method used to restore the original .aj files.

Throws:
java.io.IOException

backupAjs

public void backupAjs()
               throws java.io.IOException
Method used to backup the original aj files.

Throws:
java.io.IOException

copy

public void copy(java.io.File src,
                 java.io.File dst)
          throws java.io.IOException
It copies the file src to the file dst

Parameters:
src - the source file
dst - the destination file
Throws:
java.io.IOException

updateExpressionAspect

public int updateExpressionAspect(java.lang.String ajFileName)
                           throws java.io.IOException
It updates the @expr pointcut.

Parameters:
ajFileName - the aj file name to check.
Throws:
java.io.IOException

updateBlockAnnotation

public int updateBlockAnnotation(java.lang.String ajFileName)
                          throws java.io.IOException
It updates the @block pointcut.

Parameters:
ajFileName - the aj file name to check.
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Main used to test the class.

Parameters:
args - the exec mode to use.

start

public static int start(java.lang.String[] args)
It starts the job depending of the exec mode specified into args.

Parameters:
args - the parameters.

getAnnotationName

public static java.lang.String getAnnotationName(java.lang.String s)
Retrieve from a @expr or @block pointcut the annotation name.

Parameters:
s - the @expr or @block pointcut.

checkAnnotation

public static boolean checkAnnotation(java.lang.String a,
                                      java.lang.String b)
Used to check if the wrapperExpressionAnnotation parameters contains the specified annotation name.

Parameters:
a - the annotation name
b - the parameter of wrapperExpressionAnnotation

parseArgs

public void parseArgs(java.lang.String[] args)
Method used to parse the arguments

Parameters:
args - the list of arguments.