Package net.sourceforge.jnlp.config
Class BasicValueValidators
- java.lang.Object
-
- net.sourceforge.jnlp.config.BasicValueValidators
-
public class BasicValueValidators extends java.lang.ObjectProvidesValueValidatorimplementations for some common value types
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBasicValueValidators.RustCpValidator
-
Constructor Summary
Constructors Constructor Description BasicValueValidators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValueValidatorgetBooleanValidator()static ValueValidatorgetBrowserPathValidator()static ValueValidatorgetFilePathValidator()static ValueValidatorgetManifestAttributeCheckValidator()static ValueValidatorgetMultipleStringValidator(java.lang.String[] singleValues, java.lang.String[] comboValues)Returns aValueValidatorthat checks if an object is a string from one of the provided single option Strings or a combination from the provided combination Strings.static ValueValidatorgetRangedIntegerValidator(int low, int high)Returns aValueValidatorthat 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 ValueValidatorgetStringValidator(java.lang.String[] validValues)Returns aValueValidatorthat checks if an object is a string from one of the provided Strings.static ValueValidatorgetUrlValidator()static java.lang.String[]splitCombination(java.lang.String val)static java.lang.StringverifyFileOrCommand(java.lang.String cmd)
-
-
-
Method Detail
-
splitCombination
public static java.lang.String[] splitCombination(java.lang.String val)
-
getBooleanValidator
public static ValueValidator getBooleanValidator()
- Returns:
- a
ValueValidatorthat can be used to check if an object is a valid Boolean
-
getFilePathValidator
public static ValueValidator getFilePathValidator()
- Returns:
- a
ValueValidatorthat can be used to check if an object is a String containing a valid file path or not
-
getBrowserPathValidator
public static ValueValidator getBrowserPathValidator()
-
verifyFileOrCommand
public static java.lang.String verifyFileOrCommand(java.lang.String cmd)
-
getRangedIntegerValidator
public static ValueValidator getRangedIntegerValidator(int low, int high)
Returns aValueValidatorthat 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
public static ValueValidator getStringValidator(java.lang.String[] validValues)
Returns aValueValidatorthat 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(java.lang.String[] singleValues, java.lang.String[] comboValues)
Returns aValueValidatorthat 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
public static ValueValidator getManifestAttributeCheckValidator()
- Returns:
- a
ValueValidatorthat checks if an object is a string from the possible single or combination ManifestAttributeCheck values
-
getUrlValidator
public static ValueValidator getUrlValidator()
- Returns:
- a
ValueValidatorthat checks if an object represents a valid url
-
-