01: /*
02: * $Id: IRequestCodingStrategy.java 460102 2006-04-01 23:34:49Z jcompagner $ $Revision:
03: * 1.1 $ $Date: 2006-04-02 01:34:49 +0200 (Sun, 02 Apr 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.request;
19:
20: import wicket.IRequestTarget;
21: import wicket.Request;
22: import wicket.RequestCycle;
23:
24: /**
25: * Implementations of this interface are responsible for digesting the incoming
26: * request and creating a suitable {@link wicket.request.RequestParameters} object
27: * for it, as well as creating url representations for request targets.
28: *
29: * @author Eelco Hillenius
30: */
31: public interface IRequestCodingStrategy extends IRequestTargetMounter {
32: /**
33: * Analyze the request and create a corresponding request parameters object
34: * for it.
35: *
36: * @param request
37: * the incoming request
38: * @return a request parameters object that corresponds to the request
39: */
40: RequestParameters decode(Request request);
41:
42: /**
43: * <p>
44: * Gets the url that will point to the provided request target.
45: * </p>
46: * <p>
47: * If an implementation supports mounting, it should return the mounted path
48: * for the provided request target if any.
49: * </p>
50: *
51: * @param requestCycle
52: * the current request cycle (for efficient access)
53: *
54: * @param requestTarget
55: * the request target
56: * @return the url to the provided target
57: */
58: CharSequence encode(RequestCycle requestCycle,
59: IRequestTarget requestTarget);
60: }
|