Java tutorial
/** * PureInfo Command * @(#)SCIDeptObj.java 1.0 2007-7-19 * * Copyright(c) 2004-2005, PureInfo Information Technology Corp. Ltd. * All rights reserved, see the license file. * * www.pureinfo.com.cn */ package com.pureinfo.srm.sci.model; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.dom4j.Element; import com.pureinfo.force.exception.PureException; import com.pureinfo.force.xml.IXMLSupporter; /** * <P> * Created on 2007-7-19 03:24:51<BR> * Last modified on 2007-7-19 * </P> * SCIDeptObj * * @author sunjie * @version 1.0, 2007-7-19 * @since Command 1.0 */ public class SCIDeptObj implements IXMLSupporter { private String m_sCNName; private Map m_hENNameMap = new HashMap(); private String m_sType; private String m_sEnglishNames = ""; /** * Returns the hENName. * * @return the hENName. */ public Map getHENNameMap() { return this.m_hENNameMap; } /** * Returns the cNName. * * @return the cNName. */ public String getCNName() { return this.m_sCNName; } /** * Returns the type. * * @return the type. */ public String getType() { return this.m_sType; } /** * @see com.pureinfo.force.xml.IXMLSupporter#fromXML(org.dom4j.Element) */ public void fromXML(Element _element) throws PureException { m_sCNName = _element.attributeValue("cn-name"); m_sType = _element.attributeValue("type"); String sNames = ""; for (Iterator iter = _element.elementIterator("en-name"); iter.hasNext();) { Element ENNameElement = (Element) iter.next(); m_hENNameMap.put(ENNameElement.getText().toLowerCase(), m_sCNName); m_sEnglishNames += ENNameElement.getText().toLowerCase() + "|"; } } /** * @see com.pureinfo.force.xml.IXMLSupporter#toXMLElement(org.dom4j.Element) */ public void toXMLElement(Element _element) throws PureException { } /** * Returns the englishNames. * @return the englishNames. */ public String getEnglishNames() { return m_sEnglishNames; } /** * Sets the englishNames. * @param _sEnglishNames the englishNames to set. */ public void setEnglishNames(String _sEnglishNames) { m_sEnglishNames = _sEnglishNames; } }