PatternConstraint

public final class PatternConstraint extends FieldConstraint<V>

A constraint, which when applied to a string field, checks whether that field matches the specified pattern.

Functions

Link copied to clipboard
public void accept(ConstraintTranslator<? extends Object> visitor)
Accepts the given ConstraintTranslator.
Link copied to clipboard
public boolean allowsPartialMatch()
Checks if the pattern allows a partial match.
Link copied to clipboard
public String errorMessage(FieldContext field)
Produces an error message for the given field validation context.
Link copied to clipboard
public int flagsMask()
Obtains the pattern modifiers as a bit mask for the Pattern flags.
Link copied to clipboard
public String regex()
Obtains the regular expression as a string.

Inherited functions

Link copied to clipboard
public final FieldDeclaration field()
Link copied to clipboard
public final V optionValue()
Returns a value that describes the constraint.
Link copied to clipboard
public MessageType targetType()
The associated message type.