public final class FrenchFilters extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
BAD_SEPARATOR_FOR_EMAIL
Bad word separators chars for emails
|
static String[] |
BAD_SEPARATOR_FOR_PHONE
Chars to replace in telephone numbers
|
static String[] |
GOOD_SEPARATOR_FOR_EMAIL
Good words separators for emails
|
static String[] |
GOOD_SEPARATOR_FOR_PHONE
Chars of remplactement for telephone numbers
|
Modifier and Type | Method and Description |
---|---|
static String |
filterAlpha(String value)
Filter all alphanumeric characters.
|
static String |
filterDate(String value,
String format)
Converts Date into timestamp string.
|
static String |
filterGivenName(String oldValue)
Filter a string to match a givenName
|
static String |
filterLastName(String name)
Filter a string to match a last name
|
static String |
filterLengthString(String sn,
int length) |
static String |
filterName(String aString)
Remove trailing and starting spaces
and replace remaining spaces and dots by dashes
|
static String |
filterNumber(String value)
Filters numerical identifier.
|
static String |
filterPhone(String phone2parse)
Transform a telephone number in the international display
|
static String |
filterRegexp(String src,
String[] srcRegexp,
String[] destRegexp)
Filter the string src by removing the chars in srcRegexp
by the ones in destRegexp
|
static String |
filterShortUid(String sn)
Returns the uid on 8 chars and well formatted
|
static String |
filterSn(String sn)
Format a sn
|
static String |
filterStringRegExp(String value,
String regexp) |
static String |
filterUid(String sn)
Returns the uid on 14 chars and well formatted
|
static String |
generatePwd()
Generate a 8 chars long password
|
static String |
removeBadChars(String src)
Normalize accents and cedillas
|
static String |
toUpperCaseAllBeginningNames(String string)
Uppercased all the words of a string
|
public static final String[] BAD_SEPARATOR_FOR_EMAIL
public static final String[] GOOD_SEPARATOR_FOR_EMAIL
public static final String[] BAD_SEPARATOR_FOR_PHONE
public static final String[] GOOD_SEPARATOR_FOR_PHONE
public static String removeBadChars(String src)
src
- Source stringpublic static String filterRegexp(String src, String[] srcRegexp, String[] destRegexp)
src
- srcRegexp
- destRegexp
- public static String filterPhone(String phone2parse)
phone2parse
- public static String toUpperCaseAllBeginningNames(String string)
string
- public static String filterSn(String sn) throws CharacterUnacceptedException
sn
- CharacterUnacceptedException
- thrown if an rejected character
is encountered during analysispublic static String filterUid(String sn)
sn
- the last name to filterpublic static String filterShortUid(String sn)
sn
- the last name to filterpublic static String filterStringRegExp(String value, String regexp) throws CharacterUnacceptedException
CharacterUnacceptedException
public static String filterLastName(String name) throws CharacterUnacceptedException
name
- the last name to filterCharacterUnacceptedException
- thrown if an rejected character
is encountered during analysispublic static String filterGivenName(String oldValue) throws CharacterUnacceptedException
oldValue
- the value to filterCharacterUnacceptedException
- thrown if an rejected character
is encountered during analysispublic static String filterAlpha(String value) throws CharacterUnacceptedException
value
- the original valueCharacterUnacceptedException
- thrown if an rejected character
is encountered during analysispublic static String generatePwd()
public static String filterName(String aString)
aString
- the string to filterpublic static String filterNumber(String value) throws CharacterUnacceptedException
value
- the stringCharacterUnacceptedException
- launch if and only if the argument
is not a numerical identifierpublic static String filterDate(String value, String format) throws CharacterUnacceptedException
value
- A string representation fo a dateformat
- The format of Date with representation used by
SimpleDateFormatCharacterUnacceptedException
- thrown if an rejected character
is encountered during analysisCopyright © 2005-2024 LSC project. All Rights Reserved.