本文整理汇总了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;
}
示例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);
}
}
}
示例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()]);
}
示例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();
}
示例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