@@ -184,7 +184,7 @@ private Map<String, String> getVisParameters(final List<AbstractToken> children,
184
184
for (int i = 0 ; i < children .size (); i ++) {
185
185
AbstractToken t = children .get (i );
186
186
String controlId ;
187
- String columnName ;
187
+ String controlValue ;
188
188
189
189
// Get param name.
190
190
if (!TokenType .isString (t )) {
@@ -221,18 +221,25 @@ private Map<String, String> getVisParameters(final List<AbstractToken> children,
221
221
i ++;
222
222
if (i < children .size ()) {
223
223
t = children .get (i );
224
- if (!TokenType .isString (t )) {
225
- throw new TokenException (t , "Expected column name" );
224
+ if (TokenType .STRING .equals (t .getTokenType ()) || TokenType .PARAM .equals (t .getTokenType ())) {
225
+ final String columnName = t .getUnescapedText ();
226
+
227
+ // Validate the column name.
228
+ final Column column = columnMap .get (columnName );
229
+ if (column == null ) {
230
+ throw new TokenException (t , "Unable to find selected column: " + columnName );
231
+ }
232
+
233
+ controlValue = columnName ;
234
+
235
+ } else if (TokenType .isString (t ) || TokenType .NUMBER .equals (t .getTokenType ())) {
236
+ controlValue = t .getUnescapedText ();
237
+
238
+ } else {
239
+ throw new TokenException (t , "Expected column name or value" );
226
240
}
227
- columnName = t .getUnescapedText ();
228
241
} else {
229
- throw new TokenException (t , "Expected column name" );
230
- }
231
-
232
- // Validate the column name.
233
- final Column column = columnMap .get (columnName );
234
- if (column == null ) {
235
- throw new TokenException (t , "Unable to find selected column: " + columnName );
242
+ throw new TokenException (t , "Expected column name or value" );
236
243
}
237
244
238
245
// Strip comma if there is one.
@@ -244,8 +251,8 @@ private Map<String, String> getVisParameters(final List<AbstractToken> children,
244
251
}
245
252
}
246
253
247
- if (controlId != null && columnName != null ) {
248
- params .put (controlId , columnName );
254
+ if (controlId != null && controlValue != null ) {
255
+ params .put (controlId , controlValue );
249
256
}
250
257
}
251
258
return params ;
0 commit comments