Class 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 and org.apache.commons.collections.PredicateUtils.

    Author:
    mlowery
    • Field Detail

    • Constructor Detail

      • JobEntryValidatorUtils

        public JobEntryValidatorUtils()
    • 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 the levelOnFail type for given validatorName. If that is not found, returns generic levelOnFail type. If that fails, returns CheckResultInterface.TYPE_RESULT_ERROR.
      • putLevelOnFail

        public static void putLevelOnFail​(Map<String,​Object> map,
                                          String validatorName,
                                          int levelOnFail)
      • putLevelOnFail

        public static void putLevelOnFail​(Map<String,​Object> map,
                                          int levelOnFail)
      • getKeyLevelOnFail

        public static String getKeyLevelOnFail​(String validatorName)
      • 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)
      • addOkRemark

        public static void addOkRemark​(org.pentaho.di.core.CheckResultSourceInterface source,
                                       String propertyName,
                                       List<org.pentaho.di.core.CheckResultInterface> remarks)