Changeset 5287
- Timestamp:
- 08/14/08 23:53:02 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/logicws/web/src/org/openmrs/module/logicws/web/URLdataQuery.java
r5220 r5287 24 24 import org.apache.commons.logging.LogFactory; 25 25 26 // TODO: Auto-generated Javadoc 26 27 /** 27 28 * Helper class that extracts the important information for the URL query so … … 41 42 42 43 private Map<String, String[]> tokenSplitters; 43 44 44 45 private Map<String, String> tokenAggregateNames; 45 46 46 47 private Map<String, String> tokenAggregateValues; 47 48 // private Map<>48 49 // private Map<> 49 50 50 51 /** … … 67 68 68 69 tokenSplitters = new HashMap<String, String[]>(); 69 70 70 71 tokenAggregateNames = new HashMap<String, String>(); 71 72 72 73 tokenAggregateValues = new HashMap<String, String>(); 73 74 … … 83 84 tokensWithModifiers = select.split("\\|"); 84 85 85 // remove the split indicators, aggregates, and aggregate values 86 // remove the split indicators, aggregates, and aggregate 87 // values 86 88 for (int i = 0; i < tokensWithModifiers.length; i++) { 87 88 //get the aggregate name 89 tokenAggregateNames.put(tokensWithModifiers[i].substring(tokensWithModifiers[i].indexOf("{") + 1, tokensWithModifiers[i].indexOf("}")), tokensWithModifiers[i].split(" ")[0]); 90 91 //get the aggregate value 92 tokenAggregateValues.put(tokensWithModifiers[i].substring(tokensWithModifiers[i].indexOf("{") + 1, tokensWithModifiers[i].indexOf("}")), tokensWithModifiers[i].split(" ")[1]); 93 89 90 // get the aggregate name 91 tokenAggregateNames.put( 92 tokensWithModifiers[i] 93 .substring(tokensWithModifiers[i] 94 .indexOf("{") + 1, 95 tokensWithModifiers[i] 96 .indexOf("}")), 97 tokensWithModifiers[i].split(" ")[0]); 98 99 // get the aggregate value 100 tokenAggregateValues.put( 101 tokensWithModifiers[i] 102 .substring(tokensWithModifiers[i] 103 .indexOf("{") + 1, 104 tokensWithModifiers[i] 105 .indexOf("}")), 106 tokensWithModifiers[i].split(" ")[1]); 107 94 108 if (tokensWithModifiers[i].contains(":")) { 95 109 // populate token splitters … … 106 120 107 121 tokensWithModifiers[i] = tokensWithModifiers[i] 108 .substring(tokensWithModifiers[i].indexOf("{"), tokensWithModifiers[i] 109 .indexOf(":")); 122 .substring(tokensWithModifiers[i] 123 .indexOf("{"), 124 tokensWithModifiers[i].indexOf(":")); 110 125 111 126 } … … 140 155 return tokenSplitters.get(token); 141 156 } 142 157 158 /** 159 * Gets the token aggregate name. 160 * 161 * @param token the token 162 * 163 * @return the token aggregate name 164 */ 143 165 public String getTokenAggregateName(String token) { 144 166 return tokenAggregateNames.get(token); 145 167 } 146 168 169 /** 170 * Gets the token aggregate value. 171 * 172 * @param token the token 173 * 174 * @return the token aggregate value 175 */ 147 176 public String getTokenAggregateValue(String token) { 148 177 return tokenAggregateValues.get(token); 149 178 } 150 151 179 152 180 /**