1 15 package org.apache.tapestry.engine; 16 17 import java.util.Map ; 18 19 import org.apache.hivemind.util.Defense; 20 import org.apache.tapestry.util.QueryParameterMap; 21 22 29 public class ServiceEncodingImpl implements ServiceEncoding 30 { 31 private String _servletPath; 32 33 37 38 private final QueryParameterMap _parameters; 39 40 private boolean _modified; 41 42 public boolean isModified() 43 { 44 return _modified; 45 } 46 47 public void resetModified() 48 { 49 _modified = false; 50 } 51 52 55 56 public ServiceEncodingImpl(String servletPath) 57 { 58 this(servletPath, new QueryParameterMap()); 59 } 60 61 public ServiceEncodingImpl(String servletPath, Map parametersMap) 62 { 63 this(servletPath, new QueryParameterMap(parametersMap)); 64 } 65 66 public ServiceEncodingImpl(String servletPath, QueryParameterMap parameters) 67 { 68 Defense.notNull(servletPath, "servletPath"); 69 Defense.notNull(parameters, "parameters"); 70 71 _servletPath = servletPath; 72 73 _parameters = parameters; 74 } 75 76 public String getParameterValue(String name) 77 { 78 return _parameters.getParameterValue(name); 79 } 80 81 public String [] getParameterValues(String name) 82 { 83 return _parameters.getParameterValues(name); 84 } 85 86 public void setServletPath(String servletPath) 87 { 88 Defense.notNull(servletPath, "servletPath"); 89 90 _servletPath = servletPath; 91 _modified = true; 92 } 93 94 public void setParameterValue(String name, String value) 95 { 96 _parameters.setParameterValue(name, value); 97 98 _modified = true; 99 } 100 101 public void setParameterValues(String name, String [] values) 102 { 103 _parameters.setParameterValues(name, values); 104 105 _modified = true; 106 } 107 108 public String getServletPath() 109 { 110 return _servletPath; 111 } 112 113 public String [] getParameterNames() 114 { 115 return _parameters.getParameterNames(); 116 } 117 118 } | Popular Tags |