Package org.apache.nifi.processor.util
Class StandardValidators
java.lang.Object
org.apache.nifi.processor.util.StandardValidators
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
(package private) static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
This validator will evaluate an expression using ONLY environment properties, then validate that the result is a supported character set.static final Validator
static final Validator
static final Validator
Validator
that ensures that value is a non-empty comma separated list of hostname:portstatic final Validator
static final Validator
static final Validator
static final Validator
Validator
that ensures that value has 1+ non-whitespace charactersstatic final Validator
Validator
that ensures that value's length > 0 and that expression language is presentstatic final Validator
Validator
that ensures that value's length > 0static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
static final Validator
URL Validator that does not allow the Expression Language to be used -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Validator
createAttributeExpressionLanguageValidator
(AttributeExpression.ResultType expectedResultType) static Validator
createAttributeExpressionLanguageValidator
(AttributeExpression.ResultType expectedResultType, boolean allowExtraCharacters) static Validator
createDataSizeBoundsValidator
(long minBytesInclusive, long maxBytesInclusive) static Validator
createDirectoryExistsValidator
(boolean allowExpressionLanguage, boolean createDirectoryIfMissing) static Validator
createListValidator
(boolean trimEntries, boolean excludeEmptyEntries, Validator elementValidator) static Validator
createListValidator
(boolean trimEntries, boolean excludeEmptyEntries, Validator validator, boolean ensureElementValidation) static Validator
createLongValidator
(long minimum, long maximum, boolean inclusive) static Validator
createNonNegativeFloatingPointValidator
(double maximum) static Validator
createRegexMatchingValidator
(Pattern pattern) static Validator
createRegexMatchingValidator
(Pattern pattern, boolean evaluateExpressions) static Validator
createRegexMatchingValidator
(Pattern pattern, boolean evaluateExpressions, String validationMessage) 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 leastminCapturingGroups
capturing groups and at mostmaxCapturingGroups
capturing groups.static Validator
createTimePeriodValidator
(long minTime, TimeUnit minTimeUnit, long maxTime, TimeUnit maxTimeUnit) private static Validator
private static boolean
-
Field Details
-
ATTRIBUTE_KEY_VALIDATOR
-
ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR
-
POSITIVE_INTEGER_VALIDATOR
-
POSITIVE_LONG_VALIDATOR
-
NUMBER_VALIDATOR
-
PORT_VALIDATOR
-
NON_EMPTY_VALIDATOR
Validator
that ensures that value's length > 0 -
NON_EMPTY_EL_VALIDATOR
Validator
that ensures that value's length > 0 and that expression language is present -
HOSTNAME_PORT_LIST_VALIDATOR
Validator
that ensures that value is a non-empty comma separated list of hostname:port -
NON_BLANK_VALIDATOR
Validator
that ensures that value has 1+ non-whitespace characters -
BOOLEAN_VALIDATOR
-
INTEGER_VALIDATOR
-
LONG_VALIDATOR
-
ISO8601_INSTANT_VALIDATOR
-
NON_NEGATIVE_INTEGER_VALIDATOR
-
CHARACTER_SET_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
-
URL_VALIDATOR
URL Validator that does not allow the Expression Language to be used -
URI_VALIDATOR
-
URI_LIST_VALIDATOR
-
REGULAR_EXPRESSION_VALIDATOR
-
REGULAR_EXPRESSION_WITH_EL_VALIDATOR
-
ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR
-
TIME_PERIOD_VALIDATOR
-
DATA_SIZE_VALIDATOR
-
FILE_EXISTS_VALIDATOR
-
-
Constructor Details
-
StandardValidators
public StandardValidators()
-
-
Method Details
-
isEmpty
- 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
-
createListValidator
-
createListValidator
-
createTimePeriodValidator
-
createAttributeExpressionLanguageValidator
public static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType) -
createDataSizeBoundsValidator
public static Validator createDataSizeBoundsValidator(long minBytesInclusive, long maxBytesInclusive) -
createRegexMatchingValidator
-
createRegexMatchingValidator
-
createRegexMatchingValidator
-
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 leastminCapturingGroups
capturing groups and at mostmaxCapturingGroups
capturing groups. IfsupportAttributeExpressionLanguage
is set totrue
, 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 allowedmaxCapturingGroups
- maximum capturing groups allowedsupportAttributeExpressionLanguage
- whether or not to support expression language- Returns:
- validator
-
createAttributeExpressionLanguageValidator
public static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType, boolean allowExtraCharacters) -
createLongValidator
-
createNonNegativeFloatingPointValidator
-