/** * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.bricket.web.master; import java.io.Serializable; import org.apache.wicket.model.IModel; import org.bricket.plugin.genericdomain.domain.DomainObject; import org.bricket.web.master.IModelMaster; /** * Implementation of IModelMaster for Bricket @see DomainObject. The model can * be any type of model implementing the IModel Interface. * * @author Ingo Renner * */ public class SimpleIModelMaster<T extends DomainObject> implements Serializable, IModelMaster<T> { private final IModel<T> imodel; private Class<T> clazz; public SimpleIModelMaster(IModel<T> imodel, Class<T> clazz) { this.imodel = imodel; this.clazz = clazz; } @Override public IModel<T> getIModel() { return imodel; } @Override public Class<T> getClassOfModelObject() { return clazz; } }