|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gridsystems.innergrid.kernel.genericutils.ApiUtils
public final class ApiUtils
Class that contains some functionality used inside the api methods.
Field Summary | |
---|---|
static int |
MAX_NAME_LENGTH
Maximum allowed name size. |
static char |
SEPARATOR
General separator character. |
static java.lang.String |
VALID_CHARACTERS
List of valid Characters. |
Method Summary | |
---|---|
static java.lang.String |
checkEmptyName(java.lang.String name)
Checks if the specified name is empty or null, throwing an exception if it is. |
static java.lang.String |
checkEmptyName(java.lang.String name,
java.lang.String caption)
Checks if the specified name is empty or null, throwing an exception if it is. |
static java.lang.String |
checkEmptyParam(java.lang.String param,
java.lang.String name)
Checks if the specified String parameter is empty or null, throwing an exception if it is. |
static void |
checkName(java.lang.String name)
Checks that the name is valid. |
static void |
checkName(java.lang.String name,
java.lang.String caption)
Checks that the name is valid. |
static void |
checkNullParam(java.lang.Object param,
java.lang.String paramName)
Throws an exception if the specified parameter value is null. |
static java.lang.String |
hygienize(java.lang.String s)
It cleans 'dirty' strings, substituting dangerous characters. |
static com.gridsystems.innergrid.kernel.KernelException |
processException(java.lang.Exception e)
Converts any exception into a KernelException. |
static void |
setThreadName(java.lang.String text)
Sets the current thread name, adding the specific suffix and a timestamp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_NAME_LENGTH
public static final java.lang.String VALID_CHARACTERS
public static final char SEPARATOR
Method Detail |
---|
public static com.gridsystems.innergrid.kernel.KernelException processException(java.lang.Exception e)
e
- exception to manage and convert into a KernelException
public static void checkName(java.lang.String name) throws IllegalValueException
checkName(String, String)
with parameters name
and "name"
.
name
- The name to check
IllegalValueException
- if the name
is not valid.public static void checkName(java.lang.String name, java.lang.String caption) throws IllegalValueException
name
- The name to checkcaption
- an id to provide the user of a hint of which is the meaning
of the value in name
, if it is not valid. If this parameter
is null, it is changed by "name".
IllegalValueException
- if the name is not valid:
- If is null then throws NullParameterException
- If exceeds the length then throws StringTooLongException
- If contains invalid character then throws InvalidCharacterExceptionpublic static java.lang.String checkEmptyName(java.lang.String name) throws NullParameterException
checkEmptyName(String, String)
with parameters
name
and "name"
.
name
- The object name to check
NullParameterException
- if the specified name is null or empty.public static java.lang.String checkEmptyName(java.lang.String name, java.lang.String caption) throws NullParameterException
name
- The object name to checkcaption
- an id to provide the user of a hint of which is the meaning
of the value in name
, if it is not valid. If this parameter
is null, it is changed by "name".
NullParameterException
- if the specified name is null or empty.public static java.lang.String checkEmptyParam(java.lang.String param, java.lang.String name) throws NullParameterException
param
- The parametername
- The parameter name
NullParameterException
- if the specified parameter is null or empty.public static void setThreadName(java.lang.String text)
If a null suffix is passed, it removes the additional text, leaving the original thread name.
text
- Suffix to add to the thread namepublic static java.lang.String hygienize(java.lang.String s)
s
- String to be hygienized. If null, it is replaced by the empty
String "".
public static void checkNullParam(java.lang.Object param, java.lang.String paramName) throws NullParameterException
param
- the parameter valueparamName
- the parameter name
NullParameterException
- if param is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |