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

com.github.hugh.aop.constraints.validator.NotEmptyValidator Maven / Gradle / Ivy

There is a newer version: 2.7.14
Show newest version
package com.github.hugh.aop.constraints.validator;

import com.github.hugh.aop.constraints.NotEmpty;
import com.github.hugh.util.EmptyUtils;

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

/**
 * 不为空注解校验实现类
 *
 * @author hugh
 * @since 1.0.5
 */
public class NotEmptyValidator implements ConstraintValidator {

    @Override
    public void initialize(NotEmpty notEmpty) {

    }

    /**
     * 校验value是否不为空、
     * 

{@code false} 则抛出校验异常

* * @param value 参数 * @param constraintValidatorContext 源 * @return boolean {@code true}不为空 */ @Override public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) { return EmptyUtils.isNotEmpty(value); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy