Spring GetType method: get the type of JavaBean
•
Java
getType(String name)
Example
public static void main(String[] args){ ApplicationContext context = new ClassPathXmlApplicationContext( "appContext.xml"); //加载appContext.xml文件 Class type = context.getType("time"); //获取指定名称的JavaBean的类型 System.out.println("名称为time的JavaBean的类型是:"+type.getName()); }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码