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

📄 mmscconfig.java

📁 应用于华为中国移动甘肃项目组的彩信发送平台全套代码
💻 JAVA
字号:
package com.huawei.bass.gansu.mms.util;

import java.io.File;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.DOMBuilder;

public class MmscConfig 
{
	private String vasid;
	private String vaspid;
	private String service_code;
	private String sender_address;
	private String charged_party;
	private String charged_party_id;
	private String delivery_report;
	
	public MmscConfig()
	{
		
	}
	
	public MmscConfig(String config) throws Exception
	{
		File file = new File(config);
		if(!file.exists() || !file.isFile())
			throw new Exception("找不到mmscConfig.xml配置文件,请检查");
		DOMBuilder db = new DOMBuilder();
		Document doc = db.build(file);
		Element root = doc.getRootElement();
		Element vasid = root.getChild("VASID");
		this.vasid = vasid.getText();
		Element vaspid = root.getChild("VASPID");
		this.vaspid = vaspid.getText();
		Element service_code = root.getChild("ServiceCode");
		this.service_code = service_code.getText();
		Element sender_address = root.getChild("SenderAddress");
		this.sender_address = sender_address.getText();
		Element charged_party = root.getChild("ChargedParty");
		this.charged_party = charged_party.getText();
		Element charged_party_id = root.getChild("ChargedPartyId");
		this.charged_party_id = charged_party_id.getText();
		Element delivery_report = root.getChild("DeliveryReport");
		this.delivery_report = delivery_report.getText();
	}

	public int getCharged_party() {
		return Integer.valueOf(charged_party).intValue();
	}

	public String getCharged_party_id() {
		return charged_party_id;
	}

	public boolean getDelivery_report() {
		return delivery_report.equals("1")?true:false;
	}

	public String getSender_address() {
		return sender_address;
	}

	public String getService_code() {
		return service_code;
	}

	public String getVasid() {
		return vasid;
	}

	public String getVaspid() {
		return vaspid;
	}
	
}

⌨️ 快捷键说明

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