没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > prowide |
prowide
|
0 | 0 | 104 |
贡献者 | 讨论 | 代码提交 |
IntroductionThis project contains open source components published by prowide software, a company dedicated to financial solutions development, specialized on SWIFT messages managment systems.
Founders of prowide are long time users and advocates of open source software and are proud and glad to contribute software and artifacts to the open source community.
SWIFT fieldsParser and structured model of SWIFT fields.
The library provides a class to parse and model every possible field and letter option of a SWIFT MT message. The constructor accepts the field string literal and parses its content into a list of String with a simple and generic API of getComponent1() ... getComponentN().
If the component represents a date or number, additional API is provided to get the component parsed into a Calendar and Number with methods like getComponent1AsCalendar() and getComponent3AsNumber().
Example:
Field32A f = new Field32A("090801USD1234,56");
String sdate = f.getComponent1()); //"090801"
Calendar date = f.getComponent1AsCalendar();
BigDecimal number = new BigDecimal(f.getComponent3AsNumber().doubleValue());This library is self-contained and ready to integrate and use in several ways. But is designed to perfectly fit and complement "WIFE" open source SWIFT parser and model. A bundle with both open source projects is available to download. Using the potential of both libraries you can parse and process any SWIFT message with ease and incredible simplicity. Full parsing example:
Example:
String fin = "{1:F01BANKDEFMAXXX2039063581}"+
"{2:O1031609050901BANKDEFXAXXX89549829458949811609N}"+
"{3:{108:00750532785315}}{4:\n"+
":20:007505327853\n"+
":23B:CRED\n"+
":32A:050902JPY3520000,\n"+
":33B:JPY3520000,\n"+
":50K:EUROXXXEI\n"+
":52A:FEBXXXM1\n"+
":53A:MHCXXXJT\n"+
":54A:FOOBICXX\n"+
":59:/13212312\n"+
"RECEIVER NAME S.A\n"+
":70:FUTURES\n"+
":71A:SHA\n"+
":71F:EUR12,00\n"+
":71F:EUR2,34\n"+
"-}";
SwiftMessage m = (new SwiftParser()).parse(fin);
Field32A f = new Field32A(m.getBlock3().getTagValue("32A"));
assertEquals("010203", f.getComponent1());
assertEquals(2001, f.getComponent1AsCalendar().get(Calendar.YEAR));
assertEquals(1, f.getComponent1AsCalendar().get(Calendar.MONTH));
assertEquals(3, f.getComponent1AsCalendar().get(Calendar.DATE));
assertEquals("USD", f.getComponent2());
assertEquals(new BigDecimal(123.45), new BigDecimal(f.getComponent3AsNumber().doubleValue()));LICENSEThis components are and will be Open Source distributed under the LGPL. The license is sufficiently flexible to allow the use of this software in both open source and commercial projects. It guarantees that the code and any modifications made will stay open source, protecting our and your work. If you modify it and redistribute your modifications, the LGPL applies. Please keep the disclaimer note in the source code and submit any modifications to the project.
SUPPORTThis components and the WIFE project are creations of prowide software as a contribution to the global open source community. For commercial product and services please check our web site and contact us at info@prowidesoftware.com.