Files
ax_hub_mcp_tool/TestAnnotation.java
jade fbae7618eb
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 3m9s
fix(gateway): fix routing prefix matching and cache fallback tools
2026-08-18 20:46:27 +09:00

26 lines
686 B
Java

import org.springframework.core.annotation.AnnotationUtils;
import java.lang.annotation.*;
import java.lang.reflect.Method;
@Retention(RetentionPolicy.RUNTIME)
@interface MyTool {
String value();
}
interface MyUseCase {
@MyTool("hello")
void doSomething();
}
class MyUseCaseImpl implements MyUseCase {
public void doSomething() { }
}
public class TestAnnotation {
public static void main(String[] args) throws Exception {
Method m = MyUseCaseImpl.class.getDeclaredMethod("doSomething");
MyTool ann = AnnotationUtils.findAnnotation(m, MyTool.class);
System.out.println("Annotation found: " + (ann != null ? ann.value() : "null"));
}
}