public class ValidationUtil
extends java.lang.Object
Constructor and Description |
---|
ValidationUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cleanAndValidateId(java.lang.String id,
boolean startWithIntAllowed)
Trims the leading and trailing whitespace from the specified id
|
static void |
validateTextType(java.util.List<TextTypeWrapper> textTypes,
java.lang.String validPatternStr)
Validates that the locale in the text type is unique
|
public static void validateTextType(java.util.List<TextTypeWrapper> textTypes, java.lang.String validPatternStr) throws SdmxSemmanticException
textTypes
- SdmxSemmanticException
public static java.lang.String cleanAndValidateId(java.lang.String id, boolean startWithIntAllowed) throws SdmxSemmanticException
Validates that the id starts with an alpha character (or alpha numeric if startWithIntAllowed is true). The id may that also contains one or more of the following:
id
- The string tostartWithIntAllowed
- Determines whether an integer is allowed to be the first character of the stringSdmxSemmanticException
- if the string id not valid - empty strings or null strings are not validated