|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.baidu.unbiz.fluentvalidator.QuickValidator
public class QuickValidator
Quick validator for quickly executing template code like below:
Result ret = FluentValidator.checkAll().configure(new SimpleRegistry())
.on(car)
.doValidate()
.result(toSimple());
| 构造方法摘要 | |
|---|---|
QuickValidator()
|
|
| 方法摘要 | ||
|---|---|---|
static ComplexResult |
doAndGetComplexResult(Decorator decorator)
Execute validation by using a new FluentValidator instance without a shared context. |
|
static ComplexResult |
doAndGetComplexResult(Decorator decorator,
ValidatorContext context)
Execute validation by using a new FluentValidator instance with a shared context. |
|
static ComplexResult2 |
doAndGetComplexResult2(Decorator decorator)
Execute validation by using a new FluentValidator instance and without a shared context. |
|
static ComplexResult2 |
doAndGetComplexResult2(Decorator decorator,
ValidatorContext context)
Execute validation by using a new FluentValidator instance with a shared context. |
|
static
|
validate(Decorator decorator,
FluentValidator fluentValidator,
ValidatorContext context,
ResultCollector<T> resultCollector)
Use the decorator to add or attach more functions the given fluentValidator instance. |
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public QuickValidator()
| 方法详细信息 |
|---|
public static ComplexResult doAndGetComplexResult(Decorator decorator,
ValidatorContext context)
ComplexResult
decorator - Same as decorator design pattern, provided to add more functions to the fluentValidatorcontext - Validation context which can be shared
public static ComplexResult doAndGetComplexResult(Decorator decorator)
ComplexResult
decorator - Same as decorator design pattern, provided to add more functions to the fluentValidatorcontext - Validation context which can be shared
public static ComplexResult2 doAndGetComplexResult2(Decorator decorator,
ValidatorContext context)
ComplexResult2
decorator - Same as decorator design pattern, provided to add more functions to the fluentValidatorcontext - Validation context which can be shared
public static ComplexResult2 doAndGetComplexResult2(Decorator decorator)
ComplexResult2
decorator - Same as decorator design pattern, provided to add more functions to the fluentValidator
public static <T extends GenericResult<ValidationError>> T validate(Decorator decorator,
FluentValidator fluentValidator,
ValidatorContext context,
ResultCollector<T> resultCollector)
decorator to add or attach more functions the given fluentValidator instance.
The context can be shared and set up in the new FluentValidator instance.
The motivation for this method is to provide a quick way to launch a validation task. By just passing the validation logic which is wrapped inside the decorator, users can do validation in a ease way.
Because Java7 lacks the ability to pass "action" to a method, so there is Decorator to help
to achieve a functional programming approach to get it done. In Java8, users can replace it with lambda.
decorator - Same as decorator design pattern, provided to add more functions to the fluentValidatorfluentValidator - The base fluentValidator to be executed uponcontext - Validation context which can be sharedresultCollector - Result collector
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||