@Test public void ClaimSingle() throws DocumentException { String xml = "<xml><claims id=\"claims\">\r\n" + "<claim id=\"CLM-00001\" num=\"00001\">\r\n" + "<claim-text>The ornamental design for a pastry, as shown and described.</claim-text>\r\n" + "</claim>\r\n" + "</claims></xml>"; Document doc = DocumentHelper.parseText(xml); List<Claim> claims = new ClaimNode(doc, new FormattedText()).read(); assertEquals("CLM-00001", claims.get(0).getId()); assertEquals(ClaimType.INDEPENDENT, claims.get(0).getClaimType()); assertEquals("The ornamental design for a pastry, as shown and described.", claims.get(0).getPlainText()); }
@Override public List<Claim> read() { List<Claim> claims = new ArrayList<Claim>(); List<Node> claimNodes = CLAIMSXP.selectNodes(document); for (Node claimN : claimNodes) { Claim claim = readClaim(claimN); claims.add(claim); } return claims; }
ClaimNode extends DOMFragmentReader<List<Claim>> { @Override public List<Claim> read() { List<Claim> claims = new ArrayList<Claim>(); List<Node> claimNodes = CLAIMSXP.selectNodes(document); for (Node claimN : claimNodes) { Claim claim = readClaim(claimN); claims.add(claim); } return claims; } }
ClaimNode extends DOMFragmentReader<List<Claim>> { @Override public List<Claim> read() { List<Claim> claims = new ArrayList<Claim>(); List<Node> claimNodes = CLAIMSXP.selectNodes(document); for (Node claimN : claimNodes) { Claim claim = readClaim(claimN); claims.add(claim); } return claims; } ClaimNode(Document document, TextProcessor textProcessor); }
ClaimNode extends DOMFragmentReader<List<Claim>> { @Override public List<Claim> read() { List<Claim> claims = new ArrayList<Claim>(); List<Node> claimNodes = CLAIMSXP.selectNodes(document); for (Node claimN : claimNodes) { Claim claim = readClaim(claimN); claims.add(claim); } return claims; } ClaimNode(Document document, TextProcessor textProcessor); @Override List<Claim> read(); Claim readClaim(Node claimNode); }
ClaimNode extends DOMFragmentReader<List<Claim>> { @Override public List<Claim> read() { List<Claim> claims = new ArrayList<Claim>(); List<Node> claimNodes = CLAIMSXP.selectNodes(document); for (Node claimN : claimNodes) { Claim claim = readClaim(claimN); claims.add(claim); } return claims; } ClaimNode(Document document, TextProcessor textProcessor); @Override List<Claim> read(); Claim readClaim(Node claimNode);  }