Class StandardValidators

java.lang.Object
org.apache.nifi.processor.util.StandardValidators

public class StandardValidators extends Object
  • Field Details

    • ATTRIBUTE_KEY_VALIDATOR

      public static final Validator ATTRIBUTE_KEY_VALIDATOR
    • ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR

      public static final Validator ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR
    • POSITIVE_INTEGER_VALIDATOR

      public static final Validator POSITIVE_INTEGER_VALIDATOR
    • POSITIVE_LONG_VALIDATOR

      public static final Validator POSITIVE_LONG_VALIDATOR
    • NUMBER_VALIDATOR

      public static final Validator NUMBER_VALIDATOR
    • PORT_VALIDATOR

      public static final Validator PORT_VALIDATOR
    • NON_EMPTY_VALIDATOR

      public static final Validator NON_EMPTY_VALIDATOR
      Validator that ensures that value's length > 0
    • NON_EMPTY_EL_VALIDATOR

      public static final Validator NON_EMPTY_EL_VALIDATOR
      Validator that ensures that value's length > 0 and that expression language is present
    • HOSTNAME_PORT_LIST_VALIDATOR

      public static final Validator HOSTNAME_PORT_LIST_VALIDATOR
      Validator that ensures that value is a non-empty comma separated list of hostname:port
    • NON_BLANK_VALIDATOR

      public static final Validator NON_BLANK_VALIDATOR
      Validator that ensures that value has 1+ non-whitespace characters
    • BOOLEAN_VALIDATOR

      public static final Validator BOOLEAN_VALIDATOR
    • INTEGER_VALIDATOR

      public static final Validator INTEGER_VALIDATOR
    • LONG_VALIDATOR

      public static final Validator LONG_VALIDATOR
    • ISO8601_INSTANT_VALIDATOR

      public static final Validator ISO8601_INSTANT_VALIDATOR
    • NON_NEGATIVE_INTEGER_VALIDATOR

      public static final Validator NON_NEGATIVE_INTEGER_VALIDATOR
    • CHARACTER_SET_VALIDATOR

      public static final Validator CHARACTER_SET_VALIDATOR
    • CHARACTER_SET_VALIDATOR_WITH_EVALUATION

      public static final Validator CHARACTER_SET_VALIDATOR_WITH_EVALUATION
      This validator will evaluate an expression using ONLY environment properties, then validate that the result is a supported character set.
    • SINGLE_CHAR_VALIDATOR

      public static final Validator SINGLE_CHAR_VALIDATOR
    • URL_VALIDATOR

      public static final Validator URL_VALIDATOR
      URL Validator that does not allow the Expression Language to be used
    • URI_VALIDATOR

      public static final Validator URI_VALIDATOR
    • URI_LIST_VALIDATOR

      public static final Validator URI_LIST_VALIDATOR
    • REGULAR_EXPRESSION_VALIDATOR

      public static final Validator REGULAR_EXPRESSION_VALIDATOR
    • REGULAR_EXPRESSION_WITH_EL_VALIDATOR

      public static final Validator REGULAR_EXPRESSION_WITH_EL_VALIDATOR
    • ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR

      public static final Validator ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR
    • TIME_PERIOD_VALIDATOR

      public static final Validator TIME_PERIOD_VALIDATOR
    • DATA_SIZE_VALIDATOR

      public static final Validator DATA_SIZE_VALIDATOR
    • FILE_EXISTS_VALIDATOR

      public static final Validator FILE_EXISTS_VALIDATOR
  • Constructor Details

    • StandardValidators

      public StandardValidators()
  • Method Details

    • isEmpty

      private static boolean isEmpty(String value)
      Parameters:
      value - to test
      Returns:
      true if value is null or empty string; does not trim before testing
    • createDirectoryExistsValidator

      public static Validator createDirectoryExistsValidator(boolean allowExpressionLanguage, boolean createDirectoryIfMissing)
    • createURLValidator

      private static Validator createURLValidator()
    • createListValidator

      public static Validator createListValidator(boolean trimEntries, boolean excludeEmptyEntries, Validator elementValidator)
    • createListValidator

      public static Validator createListValidator(boolean trimEntries, boolean excludeEmptyEntries, Validator validator, boolean ensureElementValidation)
    • createTimePeriodValidator

      public static Validator createTimePeriodValidator(long minTime, TimeUnit minTimeUnit, long maxTime, TimeUnit maxTimeUnit)
    • createAttributeExpressionLanguageValidator

      public static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType)
    • createDataSizeBoundsValidator

      public static Validator createDataSizeBoundsValidator(long minBytesInclusive, long maxBytesInclusive)
    • createRegexMatchingValidator

      public static Validator createRegexMatchingValidator(Pattern pattern)
    • createRegexMatchingValidator

      public static Validator createRegexMatchingValidator(Pattern pattern, boolean evaluateExpressions, String validationMessage)
    • createRegexMatchingValidator

      public static Validator createRegexMatchingValidator(Pattern pattern, boolean evaluateExpressions)
    • createRegexValidator

      public static Validator createRegexValidator(int minCapturingGroups, int maxCapturingGroups, boolean supportAttributeExpressionLanguage)
      Creates a @{link Validator} that ensure that a value is a valid Java Regular Expression with at least minCapturingGroups capturing groups and at most maxCapturingGroups capturing groups. If supportAttributeExpressionLanguage is set to true, the value may also include the Expression Language, but the result of evaluating the Expression Language will be applied before the Regular Expression is performed. In this case, the Expression Language will not support FlowFile Attributes but only System/JVM Properties
      Parameters:
      minCapturingGroups - minimum capturing groups allowed
      maxCapturingGroups - maximum capturing groups allowed
      supportAttributeExpressionLanguage - whether or not to support expression language
      Returns:
      validator
    • createAttributeExpressionLanguageValidator

      public static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType, boolean allowExtraCharacters)
    • createLongValidator

      public static Validator createLongValidator(long minimum, long maximum, boolean inclusive)
    • createNonNegativeFloatingPointValidator

      public static Validator createNonNegativeFloatingPointValidator(double maximum)