abc.weaving.aspectinfo
Class DirectlyWithin

java.lang.Object
  extended by abc.weaving.aspectinfo.Syntax
      extended by abc.weaving.aspectinfo.Pointcut
          extended by abc.weaving.aspectinfo.LexicalPointcut
              extended by abc.weaving.aspectinfo.Within
                  extended by abc.weaving.aspectinfo.DirectlyWithin

public class DirectlyWithin
extends Within

Handler for "directlywithin" condition pointcut. This pointcut is not supported in AspectJ source. The directlywithin(ClassPattern) pointcut matches any join point lexically contained within a class matching ClassPattern, that is not also contained within a nested class.

Author:
Ganesh Sittampalam

Nested Class Summary
 
Nested classes/interfaces inherited from class abc.weaving.aspectinfo.Pointcut
Pointcut.DNF
 
Constructor Summary
DirectlyWithin(ClassnamePattern pattern, Position pos)
           
 
Method Summary
protected  Residue matchesAt(SootClass cls)
           
 boolean unify(Pointcut otherpc, Unification unification)
          Attempt to unify two pointcuts. pc.unify(pc', unification) should return true if the pointcuts can be unified, and set the renamings appropriately in unification.
 
Methods inherited from class abc.weaving.aspectinfo.Within
getPattern, matchesAt, toString
 
Methods inherited from class abc.weaving.aspectinfo.LexicalPointcut
getFreeVars, inline, matchesAt, registerSetupAdvice
 
Methods inherited from class abc.weaving.aspectinfo.Pointcut
dnf, freshVar, normalize
 
Methods inherited from class abc.weaving.aspectinfo.Syntax
getPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectlyWithin

public DirectlyWithin(ClassnamePattern pattern,
                      Position pos)
Method Detail

matchesAt

protected Residue matchesAt(SootClass cls)
Overrides:
matchesAt in class Within

unify

public boolean unify(Pointcut otherpc,
                     Unification unification)
Description copied from class: Pointcut
Attempt to unify two pointcuts. pc.unify(pc', unification) should return true if the pointcuts can be unified, and set the renamings appropriately in unification. There are two cases for unification: if unification.unifyWithFirst() is true, then the unification should only succeed if this pc can be renamed to pc', with the unification pointcut equal to this. Otherwise, the unification pointcut can be anything, as long as it can be renamed both to this and pc'.

A default implementation is provided, but all subclasses should override this - otherwise cflow CSE will be disabled for cflow that use these pointcuts.

Typical implementations for pointcuts that introduce no free variables are straightforward (see the And pointcut, for example). For pointcuts that introduce free variables, the Var.unify method is used to actually update the renamings (see the Args pointcut).

Overrides:
unify in class Within
Parameters:
otherpc - the pointcut that should be unify with this
unification - the Unification that should be set.
Returns:
true iff the unification is succesful. If true is returned, then Unification.setPointcut(the unified pointcut) must have been called in the body of unify().
See Also:
AndPointcut.unify example, Var.unify, Unification