basics:ex1
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| basics:ex1 [2007/02/23 16:09] – bdefrain | basics:ex1 [2021/02/05 13:49] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| + | [[basics: | ||
| ====== The Basics: Exercise 1 ====== | ====== The Basics: Exercise 1 ====== | ||
| - | Create an aspect named '' | + | Create an aspect named '' |
| - | Inside, write an advice | + | <code aspectj> |
| + | public aspect Basics { | ||
| + | |||
| + | public void output(String tag, Object o) { | ||
| + | System.out.println(tag + ": " + o); | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | |||
| + | Next, add an advice | ||
| <code aspectj> | <code aspectj> | ||
| before(): < | before(): < | ||
| - | | + | |
| } | } | ||
| </ | </ | ||
| <note tip> | <note tip> | ||
| - | You can employ the primitive pointcut '' | + | You can employ the primitive pointcut '' |
| </ | </ | ||
basics/ex1.1172243379.txt.gz · Last modified: by bdefrain
