public class IpValidator extends Object
AbstractValidator which checks that a given
ip is valid. It supports both IPV4 and IPV6.
In the case of IPV6, both full and collapsed addresses
are supported, but addresses containing ports are not| Constructor and Description |
|---|
IpValidator(String ip,
ValidationContext validationContext) |
| Modifier and Type | Method and Description |
|---|---|
protected ValidationResult |
fail()
Generates a
ValidationResult which ValidationResult.isError()
method returns true and which message is the return value
of getDefaultErrorMessage(). |
protected Message |
getDefaultErrorMessage()
Implementations need to implement this method to return
the error message in case the validation failed
|
protected ValidationMessages |
getMessages()
Returns the
ValidationMessages instance to use |
ValidationResult |
validate(MuleEvent event)
Performs the validation and generates a
ValidationResult back. |
public IpValidator(String ip, ValidationContext validationContext)
public ValidationResult validate(MuleEvent event)
ValidatorValidationResult back.event - the current MuleEventValidationResultprotected Message getDefaultErrorMessage()
Messageprotected ValidationMessages getMessages()
ValidationMessages instance to useValidationMessages instanceprotected ValidationResult fail()
ValidationResult which ValidationResult.isError()
method returns true and which message is the return value
of getDefaultErrorMessage(). If the error messagee is an expression,
it will be evaluated before constructing the result objectValidationResultCopyright © 2003–2023 MuleSoft, Inc.. All rights reserved.