001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.wicket.markup.html; 018 019import org.apache.wicket.IGenericComponent; 020import org.apache.wicket.Page; 021import org.apache.wicket.model.IModel; 022import org.apache.wicket.request.mapper.parameter.PageParameters; 023 024/** 025 * A {@link WebPage} with typesafe getters and setters for the model and its underlying object 026 * 027 * @param <T> 028 * the type of the page's model object 029 */ 030public class GenericWebPage<T> extends WebPage implements IGenericComponent<T, GenericWebPage<T>> 031{ 032 private static final long serialVersionUID = 1L; 033 034 /** 035 * Constructor. Having this constructor public means that your page is 'bookmarkable' and hence 036 * can be called/ created from anywhere. 037 */ 038 protected GenericWebPage() 039 { 040 super(); 041 } 042 043 /** 044 * @param model 045 * the page's model 046 * @see Page#Page(IModel) 047 */ 048 protected GenericWebPage(final IModel<T> model) 049 { 050 super(model); 051 } 052 053 /** 054 * Constructor which receives wrapped query string parameters for a request. Having this 055 * constructor public means that your page is 'bookmarkable' and hence can be called/ created 056 * from anywhere. For bookmarkable pages (as opposed to when you construct page instances 057 * yourself, this constructor will be used in preference to a no-arg constructor, if both exist. 058 * Note that nothing is done with the page parameters argument. This constructor is provided so 059 * that tools such as IDEs will include it their list of suggested constructors for derived 060 * classes. 061 * 062 * Please call this constructor if you want to remember the pageparameters 063 * {@link #getPageParameters()}. So that they are reused for stateless links. 064 * 065 * @param parameters 066 * Wrapped query string parameters. 067 */ 068 protected GenericWebPage(final PageParameters parameters) 069 { 070 super(parameters); 071 } 072}