Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support runtime-visible annotations and java.lang.reflect.Proxy
- Loading branch information
Joel Dice
committed
Sep 19, 2009
1 parent
a2a33c2
commit 7aa906d
Showing
23 changed files
with
1,278 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
/* Copyright (c) 2009, Avian Contributors | |||
Permission to use, copy, modify, and/or distribute this software | |||
for any purpose with or without fee is hereby granted, provided | |||
that the above copyright notice and this permission notice appear | |||
in all copies. | |||
There is NO WARRANTY for this software. See license.txt for | |||
details. */ | |||
|
|||
package avian; | |||
|
|||
import java.lang.reflect.Method; | |||
import java.lang.reflect.InvocationHandler; | |||
|
|||
public class AnnotationInvocationHandler implements InvocationHandler { | |||
private Object[] data; | |||
|
|||
public AnnotationInvocationHandler(Object[] data) { | |||
this.data = data; | |||
} | |||
|
|||
public Object invoke(Object proxy, Method method, Object[] arguments) { | |||
for (int i = 2; i < data.length; i += 2) { | |||
if (method.getName().equals(data[i])) { | |||
return data[i + 1]; | |||
} | |||
} | |||
throw new IllegalArgumentException(); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
/* Copyright (c) 2009, Avian Contributors | |||
Permission to use, copy, modify, and/or distribute this software | |||
for any purpose with or without fee is hereby granted, provided | |||
that the above copyright notice and this permission notice appear | |||
in all copies. | |||
There is NO WARRANTY for this software. See license.txt for | |||
details. */ | |||
|
|||
package avian; | |||
|
|||
public class Pair<A,B> { | |||
public A first; | |||
public B second; | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.