跳过导航链接
org.noear.solon.core

类 Aop

    • 构造器详细资料

      • Aop

        public Aop()
    • 方法详细资料

      • context

        public static AopContext context()
        获取Aop上下文
      • wrap

        public static BeanWrap wrap(Class<?> type,
                                    Object bean)
        包装bean,不注册
        参数:
        type - 类型
        bean - 实例
      • wrapAndPut

        public static BeanWrap wrapAndPut(Class<?> type)
        包装bean,并尝试注册
        参数:
        type - 类型
      • wrapAndPut

        public static BeanWrap wrapAndPut(Class<?> type,
                                          Object bean)
        包装bean,并尝试注册
        参数:
        type - 类型
        bean - 实例
      • has

        public static boolean has(Object nameOrType)
        检楂是否有bean
        参数:
        nameOrType - bean name or type
      • get

        public static <T> T get(String name)
        获取bean
        参数:
        name - bean name
      • get

        public static <T> T get(Class<?> type)
        获取bean
        参数:
        type - bean type
      • getOrNull

        public static <T> T getOrNull(Class<?> type)
        获取bean
        参数:
        type - bean type
      • getAsyn

        public static void getAsyn(String name,
                                   Consumer<BeanWrap> callback)
        异步获取bean
        参数:
        name - bean name
      • getAsyn

        public static void getAsyn(Class<?> type,
                                   Consumer<BeanWrap> callback)
        异步获取bean
        参数:
        type - bean type
      • inject

        public static <T> T inject(T bean)
        尝试注入
        参数:
        bean - 实例
      • inject

        public static <T> T inject(T bean,
                                   Properties propS)
        尝试用属性注入
        参数:
        bean - 实例
        propS - 属性
      • beanOnloaded

        public static void beanOnloaded(Runnable fun)
        添加Onloaded事件
      • beanForeach

        public static void beanForeach(Consumer<BeanWrap> action)
        遍历没有name的bean包装

Copyright © 2021. All rights reserved.