1 24 package org.riotfamily.website.generic.model; 25 26 import java.util.Map ; 27 28 import javax.servlet.http.HttpServletRequest ; 29 30 import org.riotfamily.common.collection.FlatMap; 31 32 36 public abstract class BaseModelBuilder implements ModelBuilder { 37 38 private String modelKey; 39 40 public void setModelKey(String modelKey) { 41 this.modelKey = modelKey; 42 } 43 44 public final Map buildModel(HttpServletRequest request) throws Exception { 45 FlatMap model = new FlatMap(); 46 model.put(modelKey, buildModelObject(request)); 47 return model; 48 } 49 50 public abstract Object buildModelObject(HttpServletRequest request) 51 throws Exception ; 52 53 } 54 | Popular Tags |