summaryrefslogtreecommitdiffstats
path: root/tests/java5/reflection/AtAspectJDeclareParents.aj
blob: c44982aae04f1fcd9a08a6e19d4c8e385d5a18db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import org.aspectj.lang.annotation.*;

public aspect AtAspectJDeclareParents {
	
	@DeclareParents(value="C",defaultImpl=Impl.class)
	private I implementedInterface;
	
}

class C {}

interface I{
	
	int getX();
	
	void setX(int x);
	
}

class Impl implements I {
	
	public Impl() {}
	
	private int x;
	
	public int getX() { return this.x; }
	
	public void setX(int x) { this.x = x; }
}