• 请不要在回答技术问题时复制粘贴 AI 生成的内容
liu1273636104
V2EX  ›  程序员

Java web 项目 CGLIB 代理类 获取 属性 注解的问题

  •  
  •   liu1273636104 · Apr 3, 2019 · 1590 views
    This topic created in 2633 days ago, the information mentioned may be changed or developed.
    1.项目里面遇到一个问题,自定义的注解 @PUSH,在 CGLIB 代理类里面无法从属性上获取,
    @Documented
    @Inherited
    @Target({ ElementType.FIELD, ElementType.METHOD })
    @Retention(RetentionPolicy.RUNTIME)
    public @interface Push {

    public String value() default "";

    }

    2.我百度过,也 google 过,其中有说到用 AnnotationUtils.findAnnotation 获取,但是这个是基于方法或者类的 没有基于属性的

    3.所以我想知道在这种情况下 有没有办法可以获取到 属性 上的自定义注解 或者
    可以帮我把 CGLIB 代理的类 转换成原本的类
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2701 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:23 · PVG 22:23 · LAX 07:23 · JFK 10:23
    ♥ Do have faith in what you're doing.