@@ -0,0 +1,1510 @@
+import org.springframework.beans.BeansException;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.context.ApplicationContextAware;%0Aimport org.springframework.stereotype.Component;%0A%0A/**%0A*@Component%E6%89%8D%E4%BC%9A%E8%A7%A6%E5%8F%91setApplicationContext%E5%91%97%E8%B0%83%E7%94%A8%0A* %E4%BD%86%E6%98%AF%E4%B8%BA%E4%BA%86%E9%81%BF%E5%85%8D%E5%BE%AA%E7%8E%AF%E4%BE%9D%E8%B5%96%E7%AD%89%E9%97%AE%E9%A2%98%EF%BC%8C%E8%B0%83%E7%94%A8%E7%9A%84%E6%97%B6%E5%80%99%E7%94%A8%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95SpringUtil.getBean%0A*%0A*/%0A@Component%0Apublic class SpringUtil implements ApplicationContextAware%0A%7B%0A    private static ApplicationContext applicationContext;%0A    %0A    private synchronized static void setContext(ApplicationContext context)%0A    %7B%0A        SpringUtil.applicationContext = context;%0A    %7D%0A    %0A    /*%0A     * (non-Javadoc)%0A     * %0A     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.%0A     * ApplicationContext)%0A     */%0A    @Override%0A    public void setApplicationContext(ApplicationContext arg0)%0A        throws BeansException%0A    %7B%0A        setContext(arg0);%0A    %7D%0A    %0A    // %E8%8E%B7%E5%8F%96applicationContext%0A    public static ApplicationContext getApplicationContext()%0A    %7B%0A        return applicationContext;%0A    %7D%0A    %0A    // %E9%80%9A%E8%BF%87name%E8%8E%B7%E5%8F%96 Bean.%0A    public static Object getBean(String name)%0A    %7B%0A        return getApplicationContext().getBean(name);%0A    %7D%0A    %0A    // %E9%80%9A%E8%BF%87class%E8%8E%B7%E5%8F%96Bean.%0A    public static %3CT%3E T getBean(Class%3CT%3E clazz)%0A    %7B%0A        return getApplicationContext().getBean(clazz);%0A    %7D%0A    %0A    // %E9%80%9A%E8%BF%87name,%E4%BB%A5%E5%8F%8AClazz%E8%BF%94%E5%9B%9E%E6%8C%87%E5%AE%9A%E7%9A%84Bean%0A    public static %3CT%3E T getBean(String name, Class%3CT%3E clazz)%0A    %7B%0A        return getApplicationContext().getBean(name, clazz);%0A    %7D%0A%7D%0A

Create SpringUtil.java