⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 person.java

📁 一个“对象--XML 映射”(Object-Xml Mapping) 的类库。 它的目的是帮助开发者方便、快速的从XML 文件构建出Java 对象
💻 JAVA
字号:
package net.sf.oxmled.mapping.sample;

// Generated by MyEclipse Persistence Tools

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.Set;

import net.sf.oxmled.mapping.annotation.XMLAttribute;
import net.sf.oxmled.mapping.annotation.XMLNode;
import net.sf.oxmled.mapping.sample.base.AbstractPerson;
import net.sf.oxmled.mapping.service.IConvertCastUtil;
import net.sf.oxmled.mapping.service.IOXmlMapping;
import net.sf.oxmled.mapping.service.OXmlMapping;



/**
 * Person generated by MyEclipse Persistence Tools
 */
@XMLNode(root=true)
public class Person extends AbstractPerson implements java.io.Serializable {
	// Fields
    @XMLAttribute(castMethod=IConvertCastUtil.castWrappedLong)
	private Long id;
    @XMLAttribute
	private String number;
    @XMLAttribute
	private String name;
	private Byte type;
	/**
	 * 因为这个子节点是集合,而其声明的类型是一个接口。所以,需要我们提供 具体的 集合类。java.util.HashSet
	 * 注意:  你必须提供有无参构造器的类,否则将无法通过反射创建对象!
	 */
	@XMLNode(concreteClass="java.util.HashSet")
	private Set licenseTags = new HashSet(0);
	// Constructors

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

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

	public Byte getType() {
		return type;
	}

	public void setType(Byte type) {
		this.type = type;
	}

	public Set getLicenseTags() {
		return licenseTags;
	}

	public void setLicenseTags(Set licenseTags) {
		this.licenseTags = licenseTags;
	}

	/** default constructor */
	public Person() {
	}

	/** minimal constructor */
	public Person(String number, Byte type) {
		super(number, type);
	}

	/** full constructor */
	public Person(String number, String name, Byte type, Set licenseTags) {
		super(number, name, type, licenseTags);
	}

	public Object get(int columnIndex) {
		/* TODO 自动生成方法存根
		 *
		 */
		if(columnIndex==0){
			return this.getNumber();
			
		}else if(columnIndex==1){
			return this.getName();
		}else if(columnIndex==2){
			return this.getType();
		}
		return null;
	}
	public static void main(String[] args) throws Exception{
		Person obj=new Person();
		obj.setId(new Long("1110"));
		obj.licenseTags.add("wo");
		obj.licenseTags.add(new Parkings());
		IOXmlMapping oXmlMapping=new OXmlMapping();
		oXmlMapping.save(obj);
		
		net.sf.oxmled.mapping.sample.Person loaded= (Person) oXmlMapping.load("net.sf.oxmled.mapping.sample.Person");
		System.out.println("aaaaaaaaaaaaaaaaa");
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -