basics:ex1
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
basics:ex1 [2007/02/23 14:36] – created 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 | + | Create |
- | 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.1172237782.txt.gz · Last modified: 2007/02/23 14:36 by bdefrain