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
public interface FieldValidator extends Serializable
An interface that allows for custom field level validation.
AFieldDescriptorcan have 0..n FieldValidators that will be invoked in order until ValidationException is thrown or all FieldValidators have been executed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanisExternalValidator()This method should be overridden if the validator implementation relies on an external resource to perform validation.voidvalidate(Field field)Implementations of this method can perform any necessary validation on the Field.
-
-
-
Method Detail
-
validate
void validate(Field field) throws ValidationException
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
-
-