ParamParser { public Collection<Object> getParameterValues() throws SemanticError, BadFetchError { final Collection<Param> paramtags = node.getChildNodes(Param.class); final Collection<Object> parameters = new java.util.ArrayList<Object>(); for (Param param : paramtags) { Object value = param.getValue(); if (value == null) { final String expr = param.getExpr(); if (expr == null) { throw new BadFetchError("Exactly one of \"value\" or " + "\"expr\" must be specified in a param tag!"); } final String unescapedExpr = StringEscapeUtils .unescapeXml(expr); value = model.evaluateExpression(unescapedExpr, Object.class); } else { final ParamValueType valueType = param.getValuetype(); if (valueType == ParamValueType.REF) { final URI uri; try { uri = new URI(value.toString()); } catch (URISyntaxException e) { throw new BadFetchError("'" + value + "' is not a valid URI"); } final String type = param.getType(); final DocumentDescriptor descriptor = new DocumentDescriptor(uri); value = server.getObject(sessionId, descriptor, type); } } parameters.add(value); } return parameters; } ParamParser(final VoiceXmlNode vxml, final DataModel dataModel,
            final DocumentServer documentServer, final Session currentSession); Map<String, Object> getParameters(); Collection<Object> getParameterValues();  }
@Test public void testGetParameterValues() throws Exception, JVoiceXMLEvent { String test = "actor"; final URI uri = map.getUri("/test"); map.addDocument(uri, test); final DataModel model = Mockito.mock(DataModel.class); Mockito.when(model.evaluateExpression("last", Object.class)) .thenReturn("Buchholz"); final VoiceXmlDocument doc = new VoiceXmlDocument(); final Vxml vxml = doc.getVxml(); final Form form = vxml.appendChild(Form.class); final ObjectTag object = form.appendChild(ObjectTag.class); final Param param1 = object.appendChild(Param.class); param1.setName("firstname"); param1.setValue("Horst"); final Param param2 = object.appendChild(Param.class); param2.setName("lastname"); param2.setExpr("last"); final Param param3 = object.appendChild(Param.class); param3.setName("job"); param3.setValue(uri.toString()); param3.setValuetype(ParamValueType.REF); param3.setType("text/plain"); final ParamParser parser = new ParamParser(object, model, server, session); final Collection<Object> params = parser.getParameterValues(); Assert.assertEquals(3, params.size()); final Iterator<Object> iterator = params.iterator(); Assert.assertEquals("Horst", iterator.next()); Assert.assertEquals("Buchholz", iterator.next()); Assert.assertEquals(test, iterator.next()); }