public class SwiftCharsetUtils
extends java.lang.Object
Note that when a SWIFT character set refers to a set of letters, lowercase or uppercase, it means only letters in English. Therefore this implementation does not use the Character API as being Character.isLetter because that would accept letters with internationalization. Instead, the integer values of the characters are used to compare them with the set of allowed characters in each case.
Modifier and Type | Field and Description |
---|---|
static int |
OK |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
filter(java.lang.String s,
SwiftCharset charset)
Returns a new string removing all characters that not belong to the parameter charset
|
static char[] |
get_a()
Gets SWIFT a charset; alphabetic capital letters (A through Z), upper case only.
|
static char[] |
get_A()
Gets SWIFT A charset; alphabetic, upper case or lower case A through Z, a through z.
|
static char[] |
get_B()
Gets SWIFT B charset; alphanumeric upper case or lower case A through Z, a through z and 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
|
static char[] |
get_c()
Gets SWIFT c charset; alpha-numeric capital letters (upper case), and digits only.
|
static char[] |
get_n()
Gets SWIFT n charset; numeric digits (0 through 9) only.
|
static char[] |
get_x()
Gets SWIFT x charset; any character of the X permitted set (General FIN application set) upper case and lower case allowed.
|
static char[] |
get_y()
Gets SWIFT y charset; any character of the Y permitted set (EDI service specific set), upper case only.
|
static char[] |
get_z()
Gets SWIFT z charset; all characters included in the X and Y sets, plus a couple of special characters.
|
static java.lang.String |
getAsString(char[] charset)
Returns a human-friendly description of the charset
|
static java.lang.String |
getAsString(SwiftCharset charset)
Returns a human-friendly description of the charset
|
static boolean |
is_a(char character)
Returns true if the parameter char is part of the a character set;
alphabetic capital letters (A through Z), upper case only
|
static boolean |
is_A(char character)
Returns true if the parameter char is part of the A character set;
alphabetic, upper case or lower case A through Z, a through z
|
static int |
is_a(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the a character set.
|
static int |
is_A(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the A character set.
|
static boolean |
is_B(char character)
Returns true if the parameter char is part of the B character set;
alphanumeric upper case or lower case A through Z, a through z and digits
|
static int |
is_B(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the B character set.
|
static boolean |
is_c(char character)
Returns true if the parameter char is part of the c character set;
alpha-numeric capital letters (upper case), and digits only
|
static int |
is_c(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the c character set.
|
static boolean |
is_n(char character)
Returns true if the parameter char is part of the n character set;
numeric digits (0 through 9) only
|
static int |
is_n(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the n character set.
|
static boolean |
is_x(char character)
Returns true if the parameter char is part of the x character set;
any character of the X permitted set (General FIN application set) upper case and lower case allowed
|
static int |
is_x(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the x character set.
|
static boolean |
is_y(char character)
Returns true if the parameter char is part of the y character set;
any character of the Y permitted set (EDI service specific set), upper case only
|
static int |
is_y(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the y character set.
|
static boolean |
is_z(char character)
Returns true if the parameter char is part of the z character set;
all characters included in the X and Y sets, plus a couple of special characters
|
static int |
is_z(java.lang.String s)
Returns this.OK (-1) if all characters of parameter string are part of the z character set.
|
static boolean |
is(char c,
SwiftCharset charset)
Checks if the character belogs to a given SWIFT charset
|
static int |
is(java.lang.String s,
SwiftCharset charset)
Checks if the string character belogs to a given SWIFT charset
|
public static final int OK
public static boolean is_n(char character)
public static int is_n(java.lang.String s)
get_n()
public static boolean is_a(char character)
public static int is_a(java.lang.String s)
get_a()
public static boolean is_x(char character)
public static int is_x(java.lang.String s)
get_x()
public static boolean is_y(char character)
public static int is_y(java.lang.String s)
get_y()
public static boolean is_z(char character)
public static int is_z(java.lang.String s)
get_z()
public static boolean is_c(char character)
public static int is_c(java.lang.String s)
get_c()
public static boolean is_A(char character)
public static int is_A(java.lang.String s)
get_A()
public static boolean is_B(char character)
public static int is_B(java.lang.String s)
get_B()
public static int is(java.lang.String s, SwiftCharset charset)
public static boolean is(char c, SwiftCharset charset)
public static java.lang.String getAsString(SwiftCharset charset)
charset
- a list of character defining a charsetpublic static char[] get_n()
public static char[] get_a()
public static char[] get_A()
public static char[] get_x()
public static char[] get_y()
public static char[] get_z()
public static char[] get_c()
public static char[] get_B()
public static java.lang.String getAsString(char[] charset)
charset
- a list of character defining a charsetpublic static java.lang.String filter(java.lang.String s, SwiftCharset charset)
s
- the string to filtercharset
- a charset to match