01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket;
18:
19: /**
20: * A factory class that creates Pages. A Page can be created by Class, with or
21: * without a PageParameters argument to pass to the Page's constructor.
22: * <p>
23: * IMPORTANT NOTE: Implementations must let subclasses of
24: * {@link org.apache.wicket.AbstractRestartResponseException} thrown from the constructing
25: * page' constructor bubble up.
26: *
27: * @see org.apache.wicket.settings.ISessionSettings#setPageFactory(IPageFactory)
28: * @see Session#getPageFactory()
29: * @see Session#getPageFactory(Page)
30: *
31: * @author Juergen Donnerstag
32: * @author Jonathan Locke
33: */
34: public interface IPageFactory {
35: /**
36: * Creates a new page using a page class.
37: *
38: * @param pageClass
39: * The page class to instantiate
40: * @return The page
41: * @throws WicketRuntimeException
42: * Thrown if the page cannot be constructed
43: */
44: Page newPage(final Class pageClass);
45:
46: /**
47: * Creates a new Page, passing PageParameters to the Page constructor if
48: * such a constructor exists. If no such constructor exists and the
49: * parameters argument is null or empty, then any available default
50: * constructor will be used.
51: *
52: * @param pageClass
53: * The class of Page to create
54: * @param parameters
55: * Any parameters to pass to the Page's constructor
56: * @return The new page
57: * @throws WicketRuntimeException
58: * Thrown if the page cannot be constructed
59: */
60: Page newPage(final Class pageClass, final PageParameters parameters);
61: }
|