1 7 package com.inversoft.verge.mvc.model.repository; 8 9 10 import java.util.Map ; 11 12 import javax.servlet.http.HttpServletRequest ; 13 14 import com.inversoft.beans.BeanException; 15 import com.inversoft.verge.mvc.MVCException; 16 import com.inversoft.verge.mvc.MVCRequest; 17 import com.inversoft.verge.mvc.model.ModelResolution; 18 import com.inversoft.verge.mvc.model.ModelResolver; 19 import com.inversoft.verge.repository.RepositoryBean; 20 21 22 32 public class RepositoryModelResolver implements ModelResolver { 33 34 37 public RepositoryModelResolver() { 38 } 39 40 41 51 public ModelResolution resolve(MVCRequest mvcRequest, String definition, 52 Map extraParams) 53 throws MVCException { 54 HttpServletRequest request = mvcRequest.getRequest(); 55 RepositoryMetaData md = new RepositoryMetaData(definition); 56 RepositoryBean rb = md.createRepositoryBean(request); 57 58 try { 59 return new ModelResolution(rb.getInstance(request), md); 60 } catch (BeanException be) { 61 throw new MVCException(be); 62 } 63 } 64 } 65 | Popular Tags |