Java tutorial
/** * PureInfo Quake * @(#)WfRole.java 1.0 Oct 13, 2005 * * Copyright(c) 2004-2005, PureInfo Information Technology Corp. Ltd. * All rights reserved, see the license file. * * www.pureinfo.com.cn */ package com.pureinfo.srm.config.workflow.model; import org.dom4j.Element; import com.pureinfo.force.exception.PureException; import com.pureinfo.force.xml.IXMLSupporter; import com.pureinfo.force.xml.XMLUtil; /** * <P> * Created on Oct 13, 2005 11:14:04 PM <BR> * Last modified on Oct 13, 2005 * </P> * * @author Freeman.Hu * @version 1.0, Oct 13, 2005 * @since Quake 1.0 */ public class WfRole implements IXMLSupporter { public final static String ATTRIBUTE_ID = "id"; public final static String ATTRIBUTE_DESC = "desc"; private String m_sName; private String m_sDesc; public String getName() { return m_sName; } public void setName(String name) { m_sName = name; } /** * @see com.pureinfo.force.xml.IXMLSupporter#toXMLElement(org.dom4j.Element) */ public void toXMLElement(Element _element) throws PureException { _element.addAttribute(ATTRIBUTE_ID, m_sName); _element.addAttribute(ATTRIBUTE_DESC, m_sDesc); } /** * @see com.pureinfo.force.xml.IXMLSupporter#fromXML(org.dom4j.Element) */ public void fromXML(Element _element) throws PureException { m_sName = XMLUtil.getRequiredAttributeValue(_element, ATTRIBUTE_ID); m_sDesc = XMLUtil.getRequiredAttributeValue(_element, ATTRIBUTE_DESC); } public String getDesc() { return m_sDesc; } public void setDesc(String desc) { m_sDesc = desc; } }