1 /* 2 * Copyright (c) 2003, Inversoft 3 * 4 * This software is distribuable under the GNU Lesser General Public License. 5 * For more information visit gnu.org. 6 */ 7 package com.inversoft.verge.mvc.model; 8 9 10 import com.inversoft.verge.mvc.MVCException; 11 import com.inversoft.verge.mvc.MVCRequest; 12 13 14 /** 15 * This interface describes the method by which the default 16 * Inversoft MVC implementation parses the HttpServletRequest 17 * parameters to handle the population of the model. 18 * Implementations of this interface are responsible for 19 * either doing the work or delegating the work of populating 20 * the model. 21 * 22 * @author Brian Pontarelli 23 * @since 2.0 24 * @version 2.0 25 */ 26 public interface ModelParser { 27 28 /** 29 * Gives the model parser and the controller implementation the chance 30 * to setup the {@link com.inversoft.verge.mvc.MVCRequest MVCRequest} objcet however they need. 31 * Usually this will be empty. 32 * 33 * @param mvcRequest The MVCRequest to setup 34 * @throws com.inversoft.verge.mvc.MVCException If there were any errors encountered 35 */ 36 void preExecute(MVCRequest mvcRequest) throws MVCException; 37 38 /** 39 * Using the MVCRequest, this method parses out the information 40 * needed to populate the model of the application and does the work or 41 * delegates the work of populating the model. Implementations should 42 * perform this operation however they see fit. 43 * 44 * @param mvcRequest This is the MVCRequest object that was created by the 45 * MVCMediator. This can be used to extract controller information 46 * that may be useful during processing of the model. 47 * @throws com.inversoft.verge.mvc.MVCException If there was any problem parse the HttpServletRequest 48 * @since 2.0 49 */ 50 void execute(MVCRequest mvcRequest) throws MVCException; 51 }