Examples of Errors


Examples of org.modelmapper.internal.Errors

   * is thrown detailing any missing mappings.
   *
   * @throws ValidationException if any TypeMaps contain unmapped properties
   */
  public void validate() {
    Errors errors = new Errors();
    for (TypeMap<?, ?> typeMap : getTypeMaps()) {
      try {
        typeMap.validate();
      } catch (ValidationException e) {
        errors.merge(e.getErrorMessages());
      }
    }

    errors.throwValidationExceptionIfErrorsExist();
  }
View Full Code Here

Examples of org.nutz.plugins.validation.Errors

  /**
   * 通过注解对一个Pojo进行验证
   */
  public Errors validate(Object target) {
    Errors errors = new Errors();
    validate(target, errors);
    return errors;
  }
View Full Code Here

Examples of org.slim3.controller.validator.Errors

        controller.servletContext = servletContext;
        controller.request = request;
        controller.response = response;
        int pos = path.lastIndexOf('/');
        controller.basePath = path.substring(0, pos + 1);
        Errors errors = (Errors) request.getAttribute(ControllerConstants.ERRORS_KEY);
        if (errors == null) {
            errors = new Errors();
            request.setAttribute(ControllerConstants.ERRORS_KEY, errors);
        }
        controller.errors = errors;
        return controller;
    }
View Full Code Here

Examples of org.sonar.server.exceptions.Errors

      verifyRequest(action, request);
      action.handler().handle(request, response);

    } catch (IllegalArgumentException e) {
      // TODO replace by BadRequestException in Request#mandatoryParam()
      sendErrors(response, 400, new Errors().add(Message.of(e.getMessage())));
    } catch (BadRequestException e) {
      sendErrors(response, 400, e.errors());
    } catch (ServerException e) {
      sendErrors(response, e.httpCode(), new Errors().add(Message.of(e.getMessage())));
    } catch (Exception e) {
      // TODO implement Request.toString()
      LoggerFactory.getLogger(getClass()).error("Fail to process request " + request, e);
      sendErrors(response, 500, new Errors().add(Message.of(e.getMessage())));
    }
  }
View Full Code Here

Examples of org.springframework.validation.Errors

            Object formBackingObject = clazz.newInstance();
            Field f = clazz.getDeclaredField(field);
            Object value = this.getValueObject(f.getType(), fieldValue);
            f.setAccessible(true);
            f.set(formBackingObject, value);
            Errors errors = validateObject(formBackingObject);
            FieldError error = errors.getFieldError(field);
            if (error != null) message = error.getCode();
        }
        return message;
    }
View Full Code Here

Examples of org.springframework.validation.Errors

        }
        return message;
    }

    public Errors validateObject(Object object) throws Exception {
        Errors errors = null;
        if (object != null)
        {
            Validator validator = this.getValidator(object.getClass());
            if (validator != null)
            {
View Full Code Here

Examples of org.springframework.validation.Errors

            Object formBackingObject = clazz.newInstance();
            Field f = clazz.getDeclaredField(field);
            Object value = this.getValueObject(f.getType(), fieldValue);
            f.setAccessible(true);
            f.set(formBackingObject, value);
            Errors errors = validateObject(formBackingObject);
            FieldError error = errors.getFieldError(field);
            if (error != null) message = error.getCode();
        }
        return message;
    }
View Full Code Here

Examples of org.springframework.validation.Errors

        }
        return message;
    }

    public Errors validateObject(Object object) throws Exception {
        Errors errors = null;
        if (object != null)
        {
            Validator validator = this.getValidator(object.getClass());
            if (validator != null)
            {
View Full Code Here

Examples of org.springframework.validation.Errors

   
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        AnnotatedTrivialObject to = new AnnotatedTrivialObject();
        to.setAnInteger(1000);
        Errors errors = systemValidator.validateObject(to);
        log.info(errors);
        return new ModelAndView("end");
    }
View Full Code Here

Examples of org.springframework.validation.Errors

     */
    @Translate
    @RemoteMethod
    @SuppressWarnings("unchecked")
    public Object validate(Class clazz, String path, DomainEntity value) throws Exception {
        Errors e = doValidation(clazz, path, value);
        return e.getFieldErrors(path + "*");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.