Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ValidationRules |
|
| 0.0;0 |
1 | /* | |
2 | * Copyright 2004-2009 the Seasar Foundation and the Others. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |
13 | * either express or implied. See the License for the specific language | |
14 | * governing permissions and limitations under the License. | |
15 | */ | |
16 | package org.seasar.cubby.validator; | |
17 | ||
18 | import java.util.Collection; | |
19 | import java.util.Map; | |
20 | ||
21 | import org.seasar.cubby.action.ActionErrors; | |
22 | import org.seasar.cubby.action.ActionResult; | |
23 | ||
24 | /** | |
25 | * アクションメソッドに対する入力検証のルールの集合です。 | |
26 | * | |
27 | * @author agata | |
28 | * @author baba | |
29 | * @since 1.0.0 | |
30 | */ | |
31 | public interface ValidationRules { | |
32 | ||
33 | /** | |
34 | * すべてのフェーズに対する入力検証を実行します。 | |
35 | * | |
36 | * @param params | |
37 | * リクエストパラメータ | |
38 | * @param formBean | |
39 | * フォームオブジェクト | |
40 | * @param actionErrors | |
41 | * アクションのエラー | |
42 | */ | |
43 | void validate(Map<String, Object[]> params, Object formBean, | |
44 | ActionErrors actionErrors); | |
45 | ||
46 | /** | |
47 | * 入力検証にエラーがあった場合に呼び出されます。 | |
48 | * | |
49 | * @param errorPage | |
50 | * エラーページ | |
51 | * @return アクションメソッド実行後の処理 | |
52 | * @see org.seasar.cubby.action.Validation#errorPage() | |
53 | */ | |
54 | ActionResult fail(String errorPage); | |
55 | ||
56 | /** | |
57 | * 入力検証のフェーズの一覧を実行順に並べた{@link Collection}として取得します。 | |
58 | * | |
59 | * @return 入力検証のフェーズ | |
60 | */ | |
61 | Collection<ValidationPhase> getValidationPhases(); | |
62 | ||
63 | /** | |
64 | * 指定された入力検証フェーズに対応する入力検証ルールの{@link Collection}を取得します。 | |
65 | * | |
66 | * @param validationPhase | |
67 | * 入力検証フェーズ | |
68 | * @return 指定された入力検証フェーズに対応する入力検証ルールの{@link Collection} | |
69 | */ | |
70 | Collection<ValidationRule> getPhaseValidationRules( | |
71 | ValidationPhase validationPhase); | |
72 | ||
73 | } |