作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
如何获取基本数据类型[xsd数据类型(如xs:byte、xs:date、xs:dateTime、xs:decimal、xs:double、xs:duration等)或iso20022类型的所有标签(例如来自 e-repository.xml 的 iso20022:Amount、iso20022:Binary、iso20022:Date、iso20022:DateTime 等)]?
最佳答案
从https://www.iso20022.org/message_archive.page下载您要实现的消息的 XSD 架构(Pain.001、Camt.053 等),借助 Eclipse、Java 和 JAXB,您可以获得 Java 类形式的所有数据模型。
编辑:
生成的数据模型示例:
Camt.053 - AmountAndCurrencyExchangeDetails4
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AmountAndCurrencyExchangeDetails4", propOrder = {
"tp",
"amt",
"ccyXchg"
})
public class AmountAndCurrencyExchangeDetails4 {
@XmlElement(name = "Tp", required = true)
protected String tp;
@XmlElement(name = "Amt", required = true)
protected ActiveOrHistoricCurrencyAndAmount amt;
@XmlElement(name = "CcyXchg")
protected CurrencyExchange5 ccyXchg;
public String getTp() {
return tp;
}
public void setTp(String value) {
this.tp = value;
}
public ActiveOrHistoricCurrencyAndAmount getAmt() {
return amt;
}
public void setAmt(ActiveOrHistoricCurrencyAndAmount value) {
this.amt = value;
}
public CurrencyExchange5 getCcyXchg() {
return ccyXchg;
}
public void setCcyXchg(CurrencyExchange5 value) {
this.ccyXchg = value;
}
}
Pain.001 - 出生日期和地点
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DateAndPlaceOfBirth", propOrder = {
"birthDt",
"prvcOfBirth",
"cityOfBirth",
"ctryOfBirth"
})
public class DateAndPlaceOfBirth {
@XmlElement(name = "BirthDt", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar birthDt;
@XmlElement(name = "PrvcOfBirth")
protected String prvcOfBirth;
@XmlElement(name = "CityOfBirth", required = true)
protected String cityOfBirth;
@XmlElement(name = "CtryOfBirth", required = true)
protected String ctryOfBirth;
public XMLGregorianCalendar getBirthDt() {
return birthDt;
}
public void setBirthDt(XMLGregorianCalendar value) {
this.birthDt = value;
}
public String getPrvcOfBirth() {
return prvcOfBirth;
}
public void setPrvcOfBirth(String value) {
this.prvcOfBirth = value;
}
public String getCityOfBirth() {
return cityOfBirth;
}
public void setCityOfBirth(String value) {
this.cityOfBirth = value;
}
public String getCtryOfBirth() {
return ctryOfBirth;
}
public void setCtryOfBirth(String value) {
this.ctryOfBirth = value;
}
}
关于xml - 如何从iso20022 的e-repository 中获取所有基本数据类型的标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37562395/
我是一名优秀的程序员,十分优秀!