../../AspectXLib/Observability/Base/aspects/AddGetterMethod.axDerived and the name of the internal variable to which the getter
method should give access is _float1. The variable is assumed to be defined in the
target class itself (as opposed to one of its superclasses).
Pointcuts | |
| class | targetClass |
| Points to the target class to which the getter method should be added | |
| function | methodImplementation |
| Points to all the implementations of the methods of the target class | |
| unit | targetUnit |
| Points to the unit where the target class is defined | |
| comment | targetClassComment |
| Points to the comment of the target class where the getter method should be added | |
Advices | |
| end | addClassComment |
| Add a comment at the end of the comment of the target class | |
| add | addMethodDeclaration |
| Add the declaration for the getter method | |
| add | addMethodDefinition |
| Add the definition for the getter method | |
name contains two other name subelements
where the first of them contains the class name and the second contains name of the method.
Therefore to access the name of the class the following expression is used:
src:name/src:name[1].
If it were
desired to capture more than one target class, this could be done by modifying the XPath
expression in the constraint to include names whose class part matches several class names.methodImplementation pointcut, namely as the unit
that contains the implementation of the method of the target class.targetClass pointcut. Triplet: comment end comment
Refers to global pointcut: comment targetClassComment
Triplet: class add declaration
accessModifier subelement to specify the access protection level of the new
method. Note also that the declaration statements are written without indentation. The
indentation is automatically inserted by the weaver to be compatible with the indentation of
other parts of the declaration file.Refers to global pointcut: class targetClass
Triplet: unit add definition
Refers to global pointcut: unit targetUnit