@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class URLArgumentValueValidator extends ArgumentValueValidator implements java.io.Serializable
Constructor and Description |
---|
URLArgumentValueValidator(java.util.Collection<java.lang.String> allowedSchemes)
Creates a new instance of this URL argument value validator that will
accept values that are URLs with any of the specified schemes.
|
URLArgumentValueValidator(java.lang.String... allowedSchemes)
Creates a new instance of this URL argument value validator that will
accept values that are URLs with any of the specified schemes.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getAllowedSchemes()
Retrieves the names of the schemes for the URLs that will be accepted.
|
java.lang.String |
toString()
Retrieves a string representation of this argument value validator.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this argument value validator to the
provided buffer.
|
void |
validateArgumentValue(Argument argument,
java.lang.String valueString)
Examines the value(s) assigned to the provided argument to determine
whether they are acceptable.
|
public URLArgumentValueValidator(@Nullable java.lang.String... allowedSchemes)
allowedSchemes
- The names of the schemes for the URLs that will be
accepted. It may be null
or empty if any
scheme will be accepted.public URLArgumentValueValidator(@Nullable java.util.Collection<java.lang.String> allowedSchemes)
allowedSchemes
- The names of the schemes for the URLs that will be
accepted. It may be null
or empty if any
scheme will be accepted.@NotNull public java.util.Set<java.lang.String> getAllowedSchemes()
public void validateArgumentValue(@NotNull Argument argument, @NotNull java.lang.String valueString) throws ArgumentException
validateArgumentValue
in class ArgumentValueValidator
argument
- The argument to which the value is being provided.valueString
- The string representation of the value to be
validated. This value will have already passed any
normal validation performed by the argument.ArgumentException
- If the provided value is determined to be
unacceptable.@NotNull public java.lang.String toString()
toString
in class java.lang.Object