JdbcXPathParameter extends NullableParameter { @Override public Object applyInputParam(AdaptrisMessage msg) throws JdbcParameterException { this.checkXPath(); NamespaceContext ctx = SimpleNamespaceContext.create(namespaceContext, msg); try { DocumentBuilderFactoryBuilder builder = documentFactoryBuilder(); XPath xpathToUse = newXPathInstance(builder, ctx); Document doc = XmlHelper.createDocument(msg, builder); String textItem = xpathToUse.selectSingleTextItem(doc, msg.resolve(getXpath())); return normalize(textItem); } catch (Exception ex) { throw new JdbcParameterException(ex); } }  @Override Object applyInputParam(AdaptrisMessage msg); @Override void applyOutputParam(Object dbValue, AdaptrisMessage msg); String getXpath(); void setXpath(String xpath); KeyValuePairSet getNamespaceContext(); void setNamespaceContext(KeyValuePairSet kvps); DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig(); void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml);  }
@Test public void testNoXPathInputParam() throws Exception { JdbcXPathParameter parameter = new JdbcXPathParameter(); try { parameter.applyInputParam(message); fail(); } catch (JdbcParameterException ex) { } }