View Javadoc

1   /*
2    * Copyright 2004-2010 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  
17  package org.seasar.cubby.routing;
18  
19  import java.lang.reflect.Method;
20  import java.util.List;
21  import java.util.regex.Pattern;
22  
23  import org.seasar.cubby.action.RequestMethod;
24  
25  /**
26   * ルーティング。
27   * 
28   * @author baba
29   */
30  public interface Routing {
31  
32  	/**
33  	 * アクションクラスを取得します。
34  	 * 
35  	 * @return アクションクラス
36  	 */
37  	Class<?> getActionClass();
38  
39  	/**
40  	 * アクションメソッドを取得します。
41  	 * 
42  	 * @return アクションメソッド
43  	 */
44  	Method getActionMethod();
45  
46  	/**
47  	 * アクションのパスを取得します。
48  	 * 
49  	 * @return アクションのパス
50  	 */
51  	String getActionPath();
52  
53  	/**
54  	 * URI パラメータ名を取得します。
55  	 * 
56  	 * @return URI パラメータ名
57  	 */
58  	List<String> getUriParameterNames();
59  
60  	/**
61  	 * 正規表現パターンを取得します。
62  	 * 
63  	 * @return 正規表現パターン
64  	 */
65  	Pattern getPattern();
66  
67  	/**
68  	 * 要求メソッドを取得します。
69  	 * 
70  	 * @return 要求メソッド
71  	 */
72  	RequestMethod getRequestMethod();
73  
74  	/**
75  	 * このルーティングを使用することを判断するためのパラメータ名を取得します。
76  	 * 
77  	 * @return パラメータ名
78  	 */
79  	String getOnSubmit();
80  
81  	/**
82  	 * プライオリティを取得します。
83  	 * 
84  	 * @return プライオリティ
85  	 */
86  	int getPriority();
87  
88  	/**
89  	 * 指定された要求メソッドがこのルーティングの対象かどうかを示します。
90  	 * 
91  	 * @param requestMethod
92  	 *            要求メソッド
93  	 * @return 対象の場合は <code>true</code>、そうでない場合は <code>false</code>
94  	 */
95  	boolean isAcceptable(final String requestMethod);
96  
97  }