|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.prowidesoftware.swift.utils.SwiftFormatUtils
public class SwiftFormatUtils
This class provides methods to convert field components to objects. It handles for example; dates, currencies and general functions defined in the SWIFT standard.
Constructor Summary | |
---|---|
SwiftFormatUtils()
|
Method Summary | |
---|---|
static java.lang.String |
getBIC(BIC bic)
Gets the code from the parameter BIC. |
static BIC |
getBIC(java.lang.String code)
|
static java.lang.String |
getCurrency(java.util.Currency currency)
Gets the currency code from the parameter Currency. |
static java.util.Currency |
getCurrency(java.lang.String code)
|
static java.lang.String |
getDate1(java.util.Calendar date)
Parses a Calendar object into a DATE1 string. |
static java.util.Calendar |
getDate1(java.lang.String strDate)
Parses a DATE1 string (accept dates in format MMDD) into a Calendar object. |
static java.lang.String |
getDate2(java.util.Calendar date)
Parses a Calendar object into a DATE2 string. |
static java.util.Calendar |
getDate2(java.lang.String strDate)
Parses a DATE2 string (accept dates in format YYMMDD) into a Calendar object. |
static java.lang.String |
getDate3(java.util.Calendar date)
Parses a Calendar object into a DATE1 string. |
static java.util.Calendar |
getDate3(java.lang.String strDate)
Parses a DATE3 string (accept dates in format YYMM) into a Calendar object. |
static java.lang.String |
getDate4(java.util.Calendar date)
Parses a Calendar object into a DATE1 string. |
static java.util.Calendar |
getDate4(java.lang.String strDate)
Parses a DATE4 string (accept dates in format YYYYMMDD) into a Calendar object. |
static java.util.Calendar |
getHhmm(java.lang.String hhmm)
|
static java.lang.String |
getNumber(java.lang.Number number)
Parses a Number into a SWIFT string number ####,## where trunked zero decimals and mandatory decimal separator. |
static java.lang.Number |
getNumber(java.lang.String amount)
Parses a value into a java Number (BigDecimal) using the comma for decimal separator. |
static java.lang.String |
getOffset(java.util.Calendar date)
Parses a Calendar object into a offset string. |
static java.util.Calendar |
getOffset(java.lang.String string)
|
static java.lang.Character |
getSign(java.lang.String string)
|
static java.lang.String |
getTime2(java.util.Calendar date)
Parses a Calendar object into a TIME2 string. |
static java.util.Calendar |
getTime2(java.lang.String hhmmss)
|
static java.lang.String |
getTime3(java.util.Calendar date)
Parses a Calendar object into a TIME3 string. |
static java.util.Calendar |
getTime3(java.lang.String hhmmss)
|
static java.lang.String |
getYear(java.util.Calendar date)
Parses a Calendar object into a YYYY string. |
static java.util.Calendar |
getYear(java.lang.String strDate)
Parses a YEAR string (accept dates in format YYYY) into a Calendar object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwiftFormatUtils()
Method Detail |
---|
public static java.util.Calendar getDate2(java.lang.String strDate)
strDate
- string to parse
null
if the argument did not matched the expected date formatpublic static java.lang.String getDate2(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Calendar getDate1(java.lang.String strDate)
strDate
- string to parse
null
if the argument did not matched the expected date formatpublic static java.lang.String getDate1(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Calendar getDate3(java.lang.String strDate)
strDate
- string to parse
null
if the argument did not matched the expected date formatpublic static java.lang.String getDate3(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Calendar getDate4(java.lang.String strDate)
strDate
- string to parse
null
if the argument did not matched the expected date formatpublic static java.lang.String getDate4(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Calendar getYear(java.lang.String strDate)
strDate
- string to parse
null
if the argument did not matched the expected date formatpublic static java.lang.String getYear(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.lang.Number getNumber(java.lang.String amount)
amount
- to parse
null
if the number could not be parsedpublic static java.lang.String getNumber(java.lang.Number number)
number
- to parse
null
if the number is nullpublic static java.util.Calendar getHhmm(java.lang.String hhmm)
hhmm
- hour and minutes
public static java.util.Calendar getTime2(java.lang.String hhmmss)
hhmmss
- hour, minutes and seconds
public static java.lang.String getTime2(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Calendar getTime3(java.lang.String hhmmss)
hhmmss
- hour, minutes and seconds
public static java.lang.String getTime3(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.lang.Character getSign(java.lang.String string)
string
- with a single character
public static java.util.Calendar getOffset(java.lang.String string)
string
- with an offset
public static java.lang.String getOffset(java.util.Calendar date)
date
- Calendar to parse
null
if the calendar is nullpublic static java.util.Currency getCurrency(java.lang.String code)
code
- string with a currency code
public static java.lang.String getCurrency(java.util.Currency currency)
currency
- Currency to use
public static BIC getBIC(java.lang.String code)
code
- string with a BIC code
public static java.lang.String getBIC(BIC bic)
bic
- BIC to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |