All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.i18n.validation.DisplayableValidator Maven / Gradle / Ivy

There is a newer version: 5.3.1
Show newest version
/*
 * Copyright (C) 2011 All rights reserved
 * VPRO The Netherlands
 */
package nl.vpro.i18n.validation;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

import nl.vpro.i18n.Displayable;

public class DisplayableValidator implements ConstraintValidator {

    @Override
    public void initialize(MustDisplay constraintAnnotation) {
    }

    @Override
    public boolean isValid(Displayable value, ConstraintValidatorContext constraintValidatorContext) {
        if(value == null) {
            return true;
        }

        return value.display();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy