| |
|
| ch.ethz.prose.crosscut.Crosscut ch.ethz.prose.crosscut.AbstractCrosscut ch.ethz.prose.crosscut.ConstructorCut
ConstructorCut | abstract public class ConstructorCut extends AbstractCrosscut implements java.io.Serializable(Code) | | Class ConstructorCut represents a crosscut. Such a crosscut
defines a pattern (for matching specific join-points) and a method
to be executed. Users must subclass ConstructorCut .
There are two main modalities for subclassing:
The tipical way (normal user)
Define exactly one method (e.g., METHOD_ARGS(Bar thisO,Baz param1) ).
This method is both the advice action to be executed and it defines
a pattern. Thus, just entries and exits of invocations of the form
Bar.*(Baz) will be considered join-points of this
crosscut.
This crosscut defines a crosscut for all entry-
points of the matched constructor.
Use pointCutter to further restrict the number of
points were advices are executed.
version: $Revision$ author: Angela Nicoara author: Gerald Linhofer |
Constructor Summary | |
protected | ConstructorCut() We want people to subclass this class. |
isInitialized | transient boolean isInitialized(Code) | | If you have more than one method in this class, determining the
name of the advice method will use the value of this method. This
variable should then be initialized with the name of the method
you want to call as advice method.
|
METHOD_ARGS | public void METHOD_ARGS()(Code) | | Override the value of this variable if you want to change the
name of the method wildcards.
|
doCreateRequest | protected CrosscutRequest doCreateRequest(Class theClass)(Code) | | Retrieve those constructors belonging to theClass
which have the same signature as the advice methods. Use the
UserDefinedMCSignature object (adviceSignature )
to determine which constructors defined in class theClass
match the pattern.
(if wildcards
are present, they use them to match more constructors in theClass )
Return a list of JoinPointRequest objects corresponding
to all locations of the matched constructors.
This implementation will return just Constructor-Entry locations..
|
getMethod | public Method getMethod()(Code) | | Get advice method, i.e. METHOD_ARGS(...) . The advice
method is used by the full code weaver.
advice method |
insertionAction | public void insertionAction(boolean beforeInsertion)(Code) | | |
isPotentialCrosscutClass | protected boolean isPotentialCrosscutClass(Class crtCls) throws MissingInformationException(Code) | | Return true only if
- This crosscut redefines the
methodAdvice method, OR
- if this crosscut defines an advice, and the corresponding
UserDefinedMCSignature
matches the target class crtCls .
|
potentialCrosscutClasses | protected Class[] potentialCrosscutClasses() throws MissingInformationException(Code) | | Return all potential classes to which this crosscut applies:
To all loaded classes, apply the isPotentialCrosscutClass
selector.
|
|
|
|