...
| Code Block | ||
|---|---|---|
| ||
// A Java 5 Annotation
public @interface Asynchronous {
int timeout() default 05;
String label();
}
// A Java 5 annotated method
@Asynchronous(timeout=5, label="will run for a while")
public Object someMethod() {
...
}
|
...
| Code Block | ||
|---|---|---|
| ||
// A Java 1.3/1.4 Annotation with backport175
public interface Asynchronous {
/**
* Default value is supported
*
* @org.codehaus.backport175.DefaultValue(5)
*/
int timeout();
String label();
}
// A Java 1.3/1.4 annotated method
/**
* @Asynchronous(timeout=5, label="will run for a while")
*/
public Object someMethod() {
...
}
|
...
