View Javadoc

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.routing;
17  
18  import java.lang.reflect.Method;
19  import java.util.List;
20  import java.util.regex.Pattern;
21  
22  import org.seasar.cubby.action.RequestMethod;
23  
24  /**
25   * ルーティング。
26   * 
27   * @author baba
28   * @since 1.1.0
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  }