Annotation processor which provides typed proxy factories that are compatible with closed-world environments. This means proxy instances created using code generated by this library can be used in GraalVM native images due to automatic detection.
import java.util.Arrays;
@Proxy
interface MyInterface {
String ping();
}
MyInterface proxy = MyInterfaceProxy.create(new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
System.out.printf("Invoked %s on %s with args %s\n", method, proxy, Arrays.toString(args));
return null;
}
});
Using gradle:
dependencies {
compileOnly 'com.palantir.proxy.processor:proxy-annotations'
annotationProcessor 'com.palantir.proxy.processor:proxy-processor'
}
./gradlew tasks
- to get the list of gradle tasks
Run one of the following commands:
./gradlew idea
for IntelliJ./gradlew eclipse
for Eclipse