Spring 简单属性注入

阅读更多
代码备份而已。
package com.clover.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class User {
	private String name;
	private int age;
	private String sex;
	private String addr;
	private Map school = new HashMap();
	private List list = new ArrayList();
	private Properties prop = new Properties();

	public User() {
	}

	public User(String sex, int age) {
		this.sex = sex;
		this.age = age;
	}

	public User(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public Map getSchool() {
		return school;
	}

	public void setSchool(Map school) {
		this.school = school;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public Properties getProp() {
		return prop;
	}

	public void setProp(Properties prop) {
		this.prop = prop;
	}

	@Override
	public String toString() {
		return "User's info\nname:" + this.name + ";age:" + this.age + ";sex:" + 
                this.sex + ";addr:" + this.addr + 
				"\nschool:" + school.toString() + "\nList:" + list.toString() +
				"\nprop:" + prop.toString();
	}

	// 简单输出
	public void hello() {
		System.out.println("Hello,world!!!");
	}
}



	
		
		
		
		
		
			
				
				
			
		
		
			
				hhh
				fuck
			
		
		
			
				11111111
				22222222
			
		
	

你可能感兴趣的:(spring,xml,java)