This shows you the differences between two versions of the page.
basics:ex1 [2007/02/23 16:58] bdefrain |
basics:ex1 [2021/02/05 13:49] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== The Basics: Exercise 1 ====== | ||
- | Create an aspect named '' | ||
- | |||
- | <code aspectj> | ||
- | public aspect Basics { | ||
- | |||
- | public void output(String tag, Object o) { | ||
- | System.out.println(tag + ": " + o); | ||
- | } | ||
- | |||
- | } | ||
- | </ | ||
- | |||
- | Next, add an advice to this aspect to prints a string just before the execution of the '' | ||
- | |||
- | <code aspectj> | ||
- | before(): < | ||
- | output(" | ||
- | } | ||
- | </ | ||
- | |||
- | <note tip> | ||
- | You can employ the primitive pointcut '' | ||
- | </ | ||
- | |||
- | Rerun the application to see the output from your aspect. | ||
- | |||
- | ---- | ||
- | |||
- | Continue with [[basics: |