当前位置: 首页>>代码示例>>Java>>正文


Java Validator.supports方法代码示例

本文整理汇总了Java中org.springframework.validation.Validator.supports方法的典型用法代码示例。如果您正苦于以下问题:Java Validator.supports方法的具体用法?Java Validator.supports怎么用?Java Validator.supports使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.validation.Validator的用法示例。


在下文中一共展示了Validator.supports方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: supports

import org.springframework.validation.Validator; //导入方法依赖的package包/类
@Override
public boolean supports(final Class<?> clazz) {
    for (final Validator validator : validators) {
        if (validator.supports(clazz)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:10,代码来源:WebConfiguratie.java

示例2: validate

import org.springframework.validation.Validator; //导入方法依赖的package包/类
@Override
public void validate(final Object target, final Errors errors) {
    for (final Validator validator : validators) {
        if (validator.supports(target.getClass())) {
            validator.validate(target, errors);
        }
    }
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:9,代码来源:WebConfiguratie.java

示例3: supportedValidatorsFor

import org.springframework.validation.Validator; //导入方法依赖的package包/类
private Validator[] supportedValidatorsFor(Class<?> clazz) {
    final Set<Validator> supportedValidators = new HashSet<>();
    for (Validator validator : validators) {
        if (validator.supports(clazz)) {
            supportedValidators.add(validator);
        }
    }
    return supportedValidators.toArray(new Validator[supportedValidators.size()]);
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:10,代码来源:CommonControllerAdvice.java

示例4: bind

import org.springframework.validation.Validator; //导入方法依赖的package包/类
/**
 * Bind request parameters onto the given command bean
 * @param request request from which parameters will be bound
 * @param command command object, that must be a JavaBean
 * @throws Exception in case of invalid state or arguments
 */
protected void bind(HttpServletRequest request, Object command) throws Exception {
	logger.debug("Binding request parameters onto MultiActionController command");
	ServletRequestDataBinder binder = createBinder(request, command);
	binder.bind(request);
	if (this.validators != null) {
		for (Validator validator : this.validators) {
			if (validator.supports(command.getClass())) {
				ValidationUtils.invokeValidator(validator, command, binder.getBindingResult());
			}
		}
	}
	binder.closeNoCatch();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:20,代码来源:MultiActionController.java

示例5: determineValidator

import org.springframework.validation.Validator; //导入方法依赖的package包/类
private Validator determineValidator(Object bean) {
	Validator validator = getValidator();
	boolean supportsBean = (validator != null && validator.supports(bean.getClass()));
	if (ClassUtils.isAssignable(Validator.class, bean.getClass())) {
		if (supportsBean) {
			return new ChainingValidator(validator, (Validator) bean);
		}
		return (Validator) bean;
	}
	return (supportsBean ? validator : null);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:ConfigurationPropertiesBindingPostProcessor.java

示例6: supports

import org.springframework.validation.Validator; //导入方法依赖的package包/类
@Override
public boolean supports(Class<?> clazz) {
	for (Validator validator : this.validators) {
		if (validator.supports(clazz)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:ConfigurationPropertiesBindingPostProcessor.java

示例7: validate

import org.springframework.validation.Validator; //导入方法依赖的package包/类
@Override
public void validate(Object target, Errors errors) {
	for (Validator validator : this.validators) {
		if (validator.supports(target.getClass())) {
			validator.validate(target, errors);
		}
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ConfigurationPropertiesBindingPostProcessor.java


注:本文中的org.springframework.validation.Validator.supports方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。