package ru.yandex.canvas.model.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Validates a {@link String} doesn't contains restricted symbols.
 *
 * @see ValidUnicodeSymbols
 */
public class ValidUnicodeSymbolsValidator implements ConstraintValidator<ValidUnicodeSymbols, String> {
    @Override
    public void initialize(ValidUnicodeSymbols constraintAnnotation) {
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return ru.yandex.canvas.model.validation.presetbased.elements.ValidUnicodeSymbolsValidator.isValid(value);
    }
}
