@Test public void testMatchSingleNode() throws Exception { XpathNodeIdentifier ident = createIdentifier(); ident.addPattern(SINGLENODE_MATCH); assertTrue("Xpath matches", ident.isThisSyntax(readInput(INPUT_FILE))); }
@Override public boolean isThisSyntax(String message) throws ServiceException { boolean rc = true; try { Document d = createDocument(message); if (d == null) { return false; } XPath xp = createXPath(); for (String xpath : getPatterns()) { Object result = null; if (resolveAsNodeset()) { result = xp.selectNodeList(d, xpath); } else { result = xp.selectSingleNode(d, xpath); } if (result == null) { rc = false; break; } } } catch (Exception e) { throw new ServiceException(e); } return rc; }
XpathNodeIdentifier extends XmlSyntaxIdentifierImpl { @Override public boolean isThisSyntax(String message) throws ServiceException { boolean rc = true; try { Document d = createDocument(message); if (d == null) { return false; } XPath xp = createXPath(); for (String xpath : getPatterns()) { Object result = null; if (resolveAsNodeset()) { result = xp.selectNodeList(d, xpath); } else { result = xp.selectSingleNode(d, xpath); } if (result == null) { rc = false; break; } } } catch (Exception e) { throw new ServiceException(e); } return rc; } }
XpathNodeIdentifier extends XmlSyntaxIdentifierImpl { @Override public boolean isThisSyntax(String message) throws ServiceException { boolean rc = true; try { Document d = createDocument(message); if (d == null) { return false; } XPath xp = createXPath(); for (String xpath : getPatterns()) { Object result = null; if (resolveAsNodeset()) { result = xp.selectNodeList(d, xpath); } else { result = xp.selectSingleNode(d, xpath); } if (result == null) { rc = false; break; } } } catch (Exception e) { throw new ServiceException(e); } return rc; } XpathNodeIdentifier();  XpathNodeIdentifier(List<String> xpaths, String dest); }
XpathNodeIdentifier extends XmlSyntaxIdentifierImpl { @Override public boolean isThisSyntax(String message) throws ServiceException { boolean rc = true; try { Document d = createDocument(message); if (d == null) { return false; } XPath xp = createXPath(); for (String xpath : getPatterns()) { Object result = null; if (resolveAsNodeset()) { result = xp.selectNodeList(d, xpath); } else { result = xp.selectSingleNode(d, xpath); } if (result == null) { rc = false; break; } } } catch (Exception e) { throw new ServiceException(e); } return rc; } XpathNodeIdentifier();  XpathNodeIdentifier(List<String> xpaths, String dest); @Override boolean isThisSyntax(String message); Boolean getResolveAsNodeset(); void setResolveAsNodeset(Boolean b); }
XpathNodeIdentifier extends XmlSyntaxIdentifierImpl { @Override public boolean isThisSyntax(String message) throws ServiceException { boolean rc = true; try { Document d = createDocument(message); if (d == null) { return false; } XPath xp = createXPath(); for (String xpath : getPatterns()) { Object result = null; if (resolveAsNodeset()) { result = xp.selectNodeList(d, xpath); } else { result = xp.selectSingleNode(d, xpath); } if (result == null) { rc = false; break; } } } catch (Exception e) { throw new ServiceException(e); } return rc; } XpathNodeIdentifier();  XpathNodeIdentifier(List<String> xpaths, String dest); @Override boolean isThisSyntax(String message); Boolean getResolveAsNodeset(); void setResolveAsNodeset(Boolean b);  }