Class AnnotationMappingProxy<T extends Annotation>

java.lang.Object
org.miaixz.bus.core.lang.annotation.resolve.AnnotationMappingProxy<T>
Type Parameters:
T - 注解类型
All Implemented Interfaces:
InvocationHandler

public final class AnnotationMappingProxy<T extends Annotation> extends Object implements InvocationHandler
代理注解处理器,用于为AnnotationMapping生成代理对象,当从该代理对象上获取属性值时, 总是通过AnnotationMapping.getResolvedAttributeValue(String, Class)获取。
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Method Details

    • create

      public static <A extends Annotation> A create(Class<? extends A> annotationType, AnnotationMapping<A> mapping)
      创建一个代理对象
      Type Parameters:
      A - 注解类型
      Parameters:
      annotationType - 注解类型
      mapping - 注解映射对象
      Returns:
      代理对象
    • isProxied

      public static boolean isProxied(Annotation annotation)
      当前注解是否由当前代理类生成
      Parameters:
      annotation - 注解对象
      Returns:
      是否
    • invoke

      public Object invoke(Object proxy, Method method, Object[] args)
      调用被代理的方法
      Specified by:
      invoke in interface InvocationHandler
      Parameters:
      proxy - 代理对象
      method - 方法
      args - 参数
      Returns:
      返回值