Spring Framework AbstractBindingResult - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AbstractBindingResult class.

This code example shows how to use the following methods:hasErrors
	public static void validate(Object object, Errors errors) {
		getRequiredValidator().validate(object, errors);
	} 
 
	public static void validate(Object object) throws BindException {
		BeanPropertyBindingResult errors = new BeanPropertyBindingResult(object, object.getClass().getSimpleName(), true);
		getRequiredValidator().validate(object, errors);
		if(errors.hasErrors()) {
			throw new BindException(errors);
		} 
	} 
	 
	public static void cleanHolder() { 
		validator = null;
	} 
} 
5
CodeRank
This code example shows how to use the following methods:hasErrors
		 
		// then validate 
		if (message != null && action.shouldValidatePayload()) { 
			SpringValidatorAdapter validatorAdapter = new SpringValidatorAdapter(messageValidator); 
			 
			BeanPropertyBindingResult result = new BeanPropertyBindingResult(message, messageClass.getName()); 
			 
			validatorAdapter.validate(message, result); 
			 
			if (result.hasErrors()) { 
				throw new MethodArgumentNotValidException(new MethodParameter(action.getMethod(), action.getPayloadParameterIndex()), result); 
			} 
		} 
		 
		return message; 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
		private static final long serialVersionUID = 1L;
 
		private List<FieldError> errors = null;
 
		protected TestBindingResult(List<FieldError> errors) {
			super(null); 
			this.errors = errors;
		} 
 
		@Override 
		public Object getTarget() {
			return null; 
		} 
 
		@Override 
		protected Object getActualFieldValue(String field) {
			return null; 
		} 
 
		@Override 
4
CodeRank
This code example shows how to use the following methods:
    /** 
     *  
     * @param inv 
     */ 
    public ParameterBindingResult(Invocation inv) {
        super(OBJECT_NAME);
        Assert.notNull(inv, "Target Invocation must not be null");
        this.inv = inv;
    } 
 
    @Override 
    public Object getTarget() {
        return this.inv;
    } 
 
    /** 
     *  
     * @throws IllegalStateException 在反序列化后调用 
     */ 
    @Override 
4
CodeRank