填补日历对象名单 : XML组件属性 « Spring « Java

En
Java
1. 图形用户界面
2. 三维图形动画
3. 高级图形
4. 蚂蚁编译
5. Apache类库
6. 统计图
7. 
8. 集合数据结构
9. 数据类型
10. 数据库JDBC
11. 设计模式
12. 开发相关类
13. EJB3
14. 电子邮件
15. 事件
16. 文件输入输出
17. 游戏
18. 泛型
19. GWT
20. Hibernate
21. 本地化
22. J2EE平台
23. 基于J2ME
24. JDK-6
25. JNDI的LDAP
26. JPA
27. JSP技术
28. JSTL
29. 语言基础知识
30. 网络协议
31. PDF格式RTF格式
32. 映射
33. 常规表达式
34. 脚本
35. 安全
36. Servlets
37. Spring
38. Swing组件
39. 图形用户界面
40. SWT-JFace-Eclipse
41. 线程
42. 应用程序
43. Velocity
44. Web服务SOA
45. 可扩展标记语言
Java 教程
Java » Spring » XML组件属性屏幕截图 
填补日历对象名单

       
File: context.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

  <bean id="collectionsExample" class="CollectionsBean">
    
    <property name="theList">
      <list>
        <value>red</value>
        <value>red</value>
        <value>blue</value>
        <ref local="curDate"/>
        
      </list>
    </property>

  </bean>
  
  <bean id="curDate" class="java.util.GregorianCalendar"/>
  
</beans>


File: Main.java

import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

class Main {
  public static void main(String args[]) throws Exception {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml");
    
    
    CollectionsBean example = (CollectionsBeanctx.getBean("collectionsExample");
   System.out.println(example.getTheList());
  
  }
}
class CollectionsBean {
  
  private List theList;
  private Set theSet;
  private Map theMap;
  private Properties theProperties;
  
  public void setTheList(List theList) {
    this.theList = theList;
  }
  public List getTheList() {
    return theList;
  }
  
  public void setTheSet(Set theSet) {
    this.theSet = theSet;
  }
  public Set getTheSet() {
    return theSet;
  }
  
  public void setTheMap(Map theMap) {
    this.theMap = theMap;
  }
  public Map getTheMap() {
    return theMap;
  }
  
  public void setTheProperties(Properties theProperties) {
    this.theProperties = theProperties;
  }
  public Properties getTheProperties() {
    return theProperties;
  }
}




           
       
Spring-FillCalendarObjectToList.zip( 2,893 k)
Related examples in the same category
1. 属性设定:网址
2. 属性设定:字符串数组
3. 属性设定:从以下网址分流
4. 属性设置:属性
5. 属性设定:整数
6. 属性设定:文件
7. 属性设定:类型
8. 属性设定:字节数组
9. 属性设定:布尔
10. 属性设定:BigDecimal
11. 属性设置:日期
12. 负载属性文件的背景
13. 懒惰的init
14. 填补值名单
15. 填补映射
16. 填补集
17. 填写属性
18. 填写清单到另一个列表
19. 创建列表映射的上下文
20. 组件注射:映射
21. 组件注射收藏:集
22. 组件注射:收集性能
23. 组件注射收藏:映射
24. 组件注射收集:名单
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.