|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.string.StringUtil
public final class StringUtil
This class provides String utils.
Method Summary | |
---|---|
static boolean |
checkAccentuatedCharacter(String strString)
This function checks if an string is in a valid format Returns true if the string is valid |
static boolean |
checkCodeKey(String strCodeKey)
Check a code key. |
static boolean |
checkEmail(String strEmail)
This function checks if an email is in a valid format Returns true if the email is valid |
static boolean |
checkEmailAndDomainName(String strEmail,
String[] strBannedDomainNames)
This function checks if an email is in a valid format, and is not in a banned domain names list. |
static boolean |
checkEmailDomainName(String strEmail,
String[] strBannedDomainNames)
Check if a domain name of an email address is not in a banned domain names list. |
static boolean |
containsHtmlSpecialCharacters(String strValue)
Checks if a string literal contains any HTML special characters (&, ", ' <, >). |
static boolean |
containsXssCharacters(String strValue)
Checks if a String contains characters that could be used for a cross-site scripting attack. |
static boolean |
containsXssCharacters(String strValue,
char[] aXssCharacters)
Checks if a String contains characters that could be used for a cross-site scripting attack. |
static boolean |
containsXssCharacters(String strValue,
String strXssCharacters)
Checks if a String contains characters that could be used for a cross-site scripting attack. |
static int |
getIntValue(String strValue,
int nDefaultValue)
Converts strValue to an int value. |
static String |
getXssCharactersAsString()
Simple convenience method to return the XSS characters as a string, to include it in error messages. |
static String |
replaceAccent(String strInit)
This function converts French diacritics characters into non diacritics. |
static String |
substitute(String strSource,
String strValue,
String strBookmark)
This function substitutes all occurences of a given bookmark by a given value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String substitute(String strSource, String strValue, String strBookmark)
strSource
- The input string that contains bookmarks to replacestrValue
- The value to substitute to the bookmarkstrBookmark
- The bookmark name
public static String replaceAccent(String strInit)
strInit
- The String to convert
public static boolean containsHtmlSpecialCharacters(String strValue)
strValue
- The string literal to check
public static boolean containsXssCharacters(String strValue)
strValue
- a character String
public static boolean containsXssCharacters(String strValue, char[] aXssCharacters)
strValue
- a character StringaXssCharacters
- a Xss characters tab to check in strValue
public static boolean containsXssCharacters(String strValue, String strXssCharacters)
strValue
- a character StringstrXssCharacters
- a String wich contain a list of Xss characters to check in strValue
public static String getXssCharactersAsString()
public static boolean checkEmail(String strEmail)
strEmail
- The mail to check
public static boolean checkEmailAndDomainName(String strEmail, String[] strBannedDomainNames)
strEmail
- The mail to checkstrBannedDomainNames
- The list of banned domain names. Domain names may start with a '@' or not.
public static boolean checkEmailDomainName(String strEmail, String[] strBannedDomainNames)
strEmail
- Email addresse to checkstrBannedDomainNames
- List of banned domain names
public static boolean checkAccentuatedCharacter(String strString)
strString
- The string to check
public static boolean checkCodeKey(String strCodeKey)
strCodeKey
- The code Key
public static int getIntValue(String strValue, int nDefaultValue)
strValue
to an int value.
strValue
- the value to convertnDefaultValue
- the default returned value
strValue
int value, nDefaultValue
if strValue is not an Integer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |