com.baidu.unbiz.fluentvalidator.exception
类 RuntimeValidateException

java.lang.Object
  继承者 java.lang.Throwable
      继承者 java.lang.Exception
          继承者 java.lang.RuntimeException
              继承者 com.baidu.unbiz.fluentvalidator.exception.RuntimeValidateException
所有已实现的接口:
Serializable

public class RuntimeValidateException
extends RuntimeException

验证器抛出运行时异常

所有验证过程中发生的异常会被这个运行时异常包装,验证调用点可以显示捕获,并且拿到内部的实际异常。一种典型的使用方法如下:

     try {
         Result ret = FluentValidator.checkAll().failFast()
             .on(car.getLicensePlate(), new CarLicensePlateValidator())
             .doValidate().result(toSimple());
     } catch (RuntimeValidateException e) {
         assertThat(e.getCause().getMessage(), is("Call Rpc failed"));
     }
 

作者:
zhangxu
另请参见:
序列化表格

构造方法摘要
RuntimeValidateException()
           
RuntimeValidateException(String message)
           
RuntimeValidateException(String message, Throwable cause)
           
RuntimeValidateException(Throwable cause)
           
 
方法摘要
 
从类 java.lang.Throwable 继承的方法
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

RuntimeValidateException

public RuntimeValidateException()

RuntimeValidateException

public RuntimeValidateException(String message)

RuntimeValidateException

public RuntimeValidateException(String message,
                                Throwable cause)

RuntimeValidateException

public RuntimeValidateException(Throwable cause)


Copyright © 2015–2016 neoremind. All rights reserved.