Interface FieldValidator
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DoubleValidator,EmailValidator,FilterableSelectionFieldDescriptor.FilterableSelectionFieldDefaultValidator,FloatValidator,HostnameValidator,HttpsURLValidator,HttpURLValidator,IntegerValidator,JwksValidator,LongValidator,PingOneEnvironmentValidator,RegExValidator,RequiredFieldValidator,SecretReferenceFieldValidator,StringLengthValidator,URLValidator
An interface that allows for custom field level validation.
A
A
FieldDescriptor can have 0..n FieldValidators
that will be invoked in order until ValidationException is thrown or all FieldValidators
have been executed.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanThis method should be overridden if the validator implementation relies on an external resource to perform validation.voidImplementations of this method can perform any necessary validation on the Field.
-
Method Details
-
validate
Implementations of this method can perform any necessary validation on the Field. If the field is deemed invalid, a ValidationException should be thrown with a descriptive error message.- Parameters:
field- the field (name and value) to validate.- Throws:
ValidationException- if the field is invalid.
-
isExternalValidator
default boolean isExternalValidator()This method should be overridden if the validator implementation relies on an external resource to perform validation. External validators are skipped if the X-BypassExternalValidation header is set to true in the Admin API request. Defaults to false.- Returns:
- if this validator relies on an external resource
- Since:
- 10.2
-