Class JobEntryValidatorUtils
- java.lang.Object
-
- org.pentaho.di.job.entry.validator.JobEntryValidatorUtils
-
public class JobEntryValidatorUtils extends Object
Methods in this class are referenced in validator definitions within the validator resources file (e.g. validator.xml).Modeled after
org.apache.struts.validator.FieldChecks
andorg.apache.commons.collections.PredicateUtils
.- Author:
- mlowery
-
-
Field Summary
Fields Modifier and Type Field Description static int
LEVEL_FAILURE_DEFAULT
-
Constructor Summary
Constructors Constructor Description JobEntryValidatorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addExceptionRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, Exception e)
static void
addFailureRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, int level)
static void
addGeneralRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, String key, int level)
static void
addOkRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks)
static AndValidator
andValidator()
Returns a AndValidator singleton.static EmailValidator
emailValidator()
Returns a EmailValidator singleton.static FileDoesNotExistValidator
fileDoesNotExistValidator()
Returns a FileDoesNotExistValidator singleton.static FileExistsValidator
fileExistsValidator()
Returns a FileExistsValidator singleton.static String
getKeyLevelOnFail(String validatorName)
static int
getLevelOnFail(ValidatorContext context, String validatorName)
Gets thelevelOnFail
type for givenvalidatorName
.static IntegerValidator
integerValidator()
Returns a IntegerValidator singleton.static LongValidator
longValidator()
Returns a LongValidator singleton.static NotBlankValidator
notBlankValidator()
Returns a NotBlankValidator singleton.static NotNullValidator
notNullValidator()
Returns a NotNullValidator singleton.static void
putLevelOnFail(Map<String,Object> map, int levelOnFail)
static void
putLevelOnFail(Map<String,Object> map, String validatorName, int levelOnFail)
static boolean
validateMask(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, int levelOnFail, List<org.pentaho.di.core.CheckResultInterface> remarks, String mask)
Fails if a field's value does not match the given mask.static boolean
validateMask(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, String mask, int levelOnFail)
Fails if a field's value does not match the given mask.
-
-
-
Field Detail
-
LEVEL_FAILURE_DEFAULT
public static final int LEVEL_FAILURE_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
andValidator
public static AndValidator andValidator()
Returns a AndValidator singleton.
-
notBlankValidator
public static NotBlankValidator notBlankValidator()
Returns a NotBlankValidator singleton.
-
notNullValidator
public static NotNullValidator notNullValidator()
Returns a NotNullValidator singleton.
-
fileExistsValidator
public static FileExistsValidator fileExistsValidator()
Returns a FileExistsValidator singleton.
-
integerValidator
public static IntegerValidator integerValidator()
Returns a IntegerValidator singleton.
-
longValidator
public static LongValidator longValidator()
Returns a LongValidator singleton.
-
fileDoesNotExistValidator
public static FileDoesNotExistValidator fileDoesNotExistValidator()
Returns a FileDoesNotExistValidator singleton.
-
emailValidator
public static EmailValidator emailValidator()
Returns a EmailValidator singleton.
-
getLevelOnFail
public static int getLevelOnFail(ValidatorContext context, String validatorName)
Gets thelevelOnFail
type for givenvalidatorName
. If that is not found, returns genericlevelOnFail
type. If that fails, returnsCheckResultInterface.TYPE_RESULT_ERROR
.
-
putLevelOnFail
public static void putLevelOnFail(Map<String,Object> map, String validatorName, int levelOnFail)
-
validateMask
public static boolean validateMask(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, String mask, int levelOnFail)
Fails if a field's value does not match the given mask.
-
validateMask
public static boolean validateMask(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, int levelOnFail, List<org.pentaho.di.core.CheckResultInterface> remarks, String mask)
Fails if a field's value does not match the given mask.
-
addFailureRemark
public static void addFailureRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, int level)
-
addExceptionRemark
public static void addExceptionRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, Exception e)
-
addGeneralRemark
public static void addGeneralRemark(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, String validatorName, List<org.pentaho.di.core.CheckResultInterface> remarks, String key, int level)
-
-