abc.weaving.aspectinfo
Class WithinConstructor
java.lang.Object
abc.weaving.aspectinfo.Syntax
abc.weaving.aspectinfo.Pointcut
abc.weaving.aspectinfo.LexicalPointcut
abc.weaving.aspectinfo.WithinConstructor
public class WithinConstructor
- extends LexicalPointcut
Handler for withincode
lexical pointcut with a constructor pattern
- Author:
- Ganesh Sittampalam
Method Summary |
ConstructorPattern |
getPattern()
|
protected Residue |
matchesAt(SootClass cls,
SootMethod method)
Do we match at a particular class and method? |
java.lang.String |
toString()
Subclasses must define toString, for debugging purposes |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
WithinConstructor
public WithinConstructor(ConstructorPattern pattern,
Position pos)
getPattern
public ConstructorPattern getPattern()
matchesAt
protected Residue matchesAt(SootClass cls,
SootMethod method)
- Description copied from class:
LexicalPointcut
- Do we match at a particular class and method?
- Specified by:
matchesAt
in class LexicalPointcut
toString
public java.lang.String toString()
- Description copied from class:
Pointcut
- Subclasses must define toString, for debugging purposes
- Specified by:
toString
in class Pointcut
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 Pointcut
- Parameters:
otherpc
- the pointcut that should be unify with thisunification
- 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