public class StandardValidators extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StandardValidators.DirectoryExistsValidator |
static class |
StandardValidators.FileExistsValidator |
static class |
StandardValidators.StringLengthValidator |
(package private) static class |
StandardValidators.TimePeriodValidator |
Constructor and Description |
---|
StandardValidators() |
Modifier and Type | Method and Description |
---|---|
static 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 validator) |
static Validator |
createLongValidator(long minimum,
long maximum,
boolean inclusive) |
static Validator |
createRegexMatchingValidator(Pattern pattern) |
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. |
static Validator |
createTimePeriodValidator(long minTime,
TimeUnit minTimeUnit,
long maxTime,
TimeUnit maxTimeUnit) |
static Validator |
createURLorFileValidator() |
private static Validator |
createURLValidator() |
private static boolean |
isEmpty(String value) |
public static final Validator ATTRIBUTE_KEY_VALIDATOR
public static final Validator ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR
public static final Validator POSITIVE_INTEGER_VALIDATOR
public static final Validator POSITIVE_LONG_VALIDATOR
public static final Validator NUMBER_VALIDATOR
public static final Validator PORT_VALIDATOR
public static final Validator NON_EMPTY_VALIDATOR
Validator
that ensures that value's length > 0public static final Validator NON_EMPTY_EL_VALIDATOR
Validator
that ensures that value's length > 0 and that expression language is presentpublic static final Validator HOSTNAME_PORT_LIST_VALIDATOR
Validator
that ensures that value is a non-empty comma separated list of hostname:portpublic static final Validator NON_BLANK_VALIDATOR
Validator
that ensures that value has 1+ non-whitespace
characterspublic static final Validator BOOLEAN_VALIDATOR
public static final Validator INTEGER_VALIDATOR
public static final Validator LONG_VALIDATOR
public static final Validator ISO8601_INSTANT_VALIDATOR
@Deprecated public static final Validator ISO8061_INSTANT_VALIDATOR
public static final Validator NON_NEGATIVE_INTEGER_VALIDATOR
public static final Validator CHARACTER_SET_VALIDATOR
public static final Validator CHARACTER_SET_VALIDATOR_WITH_EVALUATION
public static final Validator URL_VALIDATOR
public static final Validator URI_VALIDATOR
public static final Validator URI_LIST_VALIDATOR
public static final Validator REGULAR_EXPRESSION_VALIDATOR
public static final Validator ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR
public static final Validator TIME_PERIOD_VALIDATOR
public static final Validator DATA_SIZE_VALIDATOR
public static final Validator FILE_EXISTS_VALIDATOR
private static boolean isEmpty(String value)
value
- to testpublic static Validator createDirectoryExistsValidator(boolean allowExpressionLanguage, boolean createDirectoryIfMissing)
private static Validator createURLValidator()
public static Validator createURLorFileValidator()
public static Validator createListValidator(boolean trimEntries, boolean excludeEmptyEntries, Validator validator)
public static Validator createTimePeriodValidator(long minTime, TimeUnit minTimeUnit, long maxTime, TimeUnit maxTimeUnit)
public static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType)
public static Validator createDataSizeBoundsValidator(long minBytesInclusive, long maxBytesInclusive)
public static Validator createRegexValidator(int minCapturingGroups, int maxCapturingGroups, boolean supportAttributeExpressionLanguage)
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
PropertiesminCapturingGroups
- minimum capturing groups allowedmaxCapturingGroups
- maximum capturing groups allowedsupportAttributeExpressionLanguage
- whether or not to support
expression languagepublic static Validator createAttributeExpressionLanguageValidator(AttributeExpression.ResultType expectedResultType, boolean allowExtraCharacters)
public static Validator createLongValidator(long minimum, long maximum, boolean inclusive)
Copyright © 2019 Apache NiFi Project. All rights reserved.