public final class UriAddressConstraint extends CheckConstraint<String>
CheckConstraint
implementation that checks
whether a string is valid URI reference. Also the allowed set of schemes
can be configured.UriAddress
,
ConstraintFactory.uriAddress()
,
ConstraintFactory.uriAddress(String...)
Modifier and Type | Field and Description |
---|---|
static UriAddressConstraint |
DEFAULT
UriAddressConstraint default instance initialized with
empty set of schemes. |
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
schemes argument that contains set of allowed
schemes. |
protected <T> boolean |
check(String value,
ValidationContext<T> context)
Checks whether the specified string is valid URI reference with allowed
scheme.
|
Set<String> |
getSchemes()
Returns set of allowed schemes (empty set means all schemes are
allowed).
|
Class<?> |
getType()
Returns
java.lang.String type. |
validate
getMessageTemplate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTemplate
public static final UriAddressConstraint DEFAULT
UriAddressConstraint
default instance initialized with
empty set of schemes.public Class<?> getType()
java.lang.String
type.java.lang.String
type.public Set<String> getSchemes()
public boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
schemes
argument that contains set of allowed
schemes.appendMessageArguments
in interface Constraint<String>
appendMessageArguments
in interface Validation<String>
appendMessageArguments
in class AbstractValidation<String>
context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
.protected <T> boolean check(String value, ValidationContext<T> context)
check
in class CheckConstraint<String>
T
- The type of validated entity.value
- URI string.context
- Validation context.true
if the specified string is valid URI reference
with allowed scheme; false
otherwise.Copyright © 2011–2020 FoxLabs. All rights reserved.