public void testIsSerializable() throws JaxenException, IOException { BaseXPath path = new BaseXPath("//foo", new DocumentNavigator()); ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(out); oos.writeObject(path); oos.close(); assertTrue(out.toByteArray().length > 0); }
final Java15Parser parser = new Java15Parser(); final FileInputStream stream = new FileInputStream("VehicleServiceType.java"); final Object c = parser.parse(new InputStreamReader(stream)); final XPath xpath = new BaseXPath("//TypeDeclaration/Annotation/NormalAnnotation[Name/@Image = 'WebService']", new DocumentNavigator()); for (final Iterator iter = xpath.selectNodes(c).iterator(); iter.hasNext();) { final Object obj = iter.next(); // Do code generation based on annotations... }
final Java15Parser parser = new Java15Parser(); final FileInputStream stream = new FileInputStream("VehicleServiceType.java"); final Object c = parser.parse(new InputStreamReader(stream)); final XPath xpath = new BaseXPath("//TypeDeclaration/Annotation/NormalAnnotation[Name/@Image = 'WebService']", new DocumentNavigator()); for (final Iterator iter = xpath.selectNodes(c).iterator(); iter.hasNext();) { final Object obj = iter.next(); // Do code generation based on annotations... }
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService, namespacePrefixResolver, followAllParentLinks); NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService, namespacePrefixResolver, followAllParentLinks); NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService, namespacePrefixResolver, followAllParentLinks); NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService, namespacePrefixResolver, followAllParentLinks); NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
public void testGetChildAxisIterator() throws UnsupportedAxisException { try { // Check true DocumentNavigator docNav = new DocumentNavigator(null, null, null, null, false, false); Iterator nodeIter = docNav.getChildAxisIterator(null, "true", "", null); assertNotNull(nodeIter); boolean value = (Boolean) nodeIter.next(); assertTrue("The true value should be returned. See MNT-10730", value); // Check false nodeIter = docNav.getChildAxisIterator(null, "false", "", null); assertNotNull(nodeIter); value = (Boolean) nodeIter.next(); assertFalse("The false value should be returned. See MNT-10730", value); } catch (NullPointerException exp) { fail("The boolean value should be returned. See MNT-10730"); } } }
namespacePrefixResolver.registerNamespace(BaseNodeServiceTest.TEST_PREFIX, BaseNodeServiceTest.NAMESPACE); DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searcher, namespacePrefixResolver, false, false);