1 2 6 7 8 package org.joseki.server; 9 10 11 import java.util.* ; 12 13 19 public class RequestImpl implements Request 20 { 21 Processor processor ; 23 ModelSource modelSource ; 24 Dispatcher dispatcher ; 25 26 String opName = null; 28 String modelURI = null ; 29 String requestURL = null ; 30 31 final static Object noValue = new Object () ; 32 List args = new ArrayList(); 35 Map params = new HashMap(); 36 37 public RequestImpl(String u, String url, String name, Dispatcher d, ModelSource aModel, Processor proc) 38 { 39 modelURI = u ; 40 requestURL = url ; 41 opName = name ; 42 dispatcher = d ; 43 modelSource = aModel ; 44 processor = proc ; 45 } 46 47 public boolean takesArg() { return true ; } 48 49 public boolean containsParam(String name) { return params.containsKey(name) ; } 50 51 public void setParam(String name, String value) 52 { 53 if ( value == null ) 54 params.put(name, noValue) ; 55 else 56 params.put(name, value) ; 57 } 58 59 public void addArg(Object m) { args.add(m) ; } 60 61 public String getName() { return opName ; } 62 public String getModelURI() { return modelURI ; } 63 public String getRequestURL() { return requestURL ; } 64 65 public ModelSource getModelSource() { return modelSource ; } 66 public Processor getProcessor() { return processor ; } 67 public void setProcessor(Processor proc) { processor = proc ; } 68 public Dispatcher getDispatcher() { return dispatcher ; } 69 70 public Map getParams() { return params ; } 71 public String getParam(String param) { return (String )params.get(param); } 72 73 public List getDataArgs() { return args ; } 74 } 75 76 102 | Popular Tags |