Package net.sourceforge.jnlp.config
Class BasicValueValidators
java.lang.Object
net.sourceforge.jnlp.config.BasicValueValidators
Provides
ValueValidator
implementations for some common value types-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueValidator
static ValueValidator
static ValueValidator
static ValueValidator
static ValueValidator
getMultipleStringValidator
(String[] singleValues, String[] comboValues) Returns aValueValidator
that checks if an object is a string from one of the provided single option Strings or a combination from the provided combination Strings.static ValueValidator
getRangedIntegerValidator
(int low, int high) Returns aValueValidator
that checks if an object represents a valid integer (it is a Integer or Long or a String representation of one), within the given range.static ValueValidator
getStringValidator
(String[] validValues) Returns aValueValidator
that checks if an object is a string from one of the provided Strings.static ValueValidator
static String[]
splitCombination
(String val) static String
-
Constructor Details
-
BasicValueValidators
public BasicValueValidators()
-
-
Method Details
-
splitCombination
-
getBooleanValidator
- Returns:
- a
ValueValidator
that can be used to check if an object is a valid Boolean
-
getFilePathValidator
- Returns:
- a
ValueValidator
that can be used to check if an object is a String containing a valid file path or not
-
getBrowserPathValidator
-
verifyFileOrCommand
-
getRangedIntegerValidator
Returns aValueValidator
that checks if an object represents a valid integer (it is a Integer or Long or a String representation of one), within the given range. The values are inclusive.- Parameters:
low
- the lowest valid valuehigh
- the highest valid value- Returns:
- value validator for given range
-
getStringValidator
Returns aValueValidator
that checks if an object is a string from one of the provided Strings.- Parameters:
validValues
- an array of Strings which are considered valid- Returns:
- validator for given strings
-
getMultipleStringValidator
public static ValueValidator getMultipleStringValidator(String[] singleValues, String[] comboValues) Returns aValueValidator
that checks if an object is a string from one of the provided single option Strings or a combination from the provided combination Strings.- Parameters:
singleValues
- an array of Strings which are considered valid only by themselvescomboValues
- an array of Strings which are considered valid in any combination with themselves- Returns:
- validator forgiven strings
-
getManifestAttributeCheckValidator
- Returns:
- a
ValueValidator
that checks if an object is a string from the possible single or combination ManifestAttributeCheck values
-
getUrlValidator
- Returns:
- a
ValueValidator
that checks if an object represents a valid url
-