Validates user emails to ensure uniqueness in the database.
// Source: https://github.com/OrienteerBAP/Orienteer | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package org.orienteer.users.validation;
import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.ValidationError;
import org.orienteer.users.repository.OrienteerUserRepository;
/**
* Check if given mail not exists in database.
* If mail exists in database, so will be created error with key "UserEmailValidator" and variable "email"
*/
public class UserEmailValidator implements IValidator<String> {
@Override
public void validate(IValidatable<String> validatable) {
String email = validata
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key