@Override public final Node getNodeForNodeId(NodeId id) { Node n = NodeId.extract(id) ; if ( n != null ) return n ; return super.getNodeForNodeId(id) ; }
private void test(String x, Node correct) { Node n = NodeFactoryExtra.parseNode(x) ; NodeId nodeId = NodeId.inline(n) ; boolean b = NodeId.hasInlineDatatype(n) ; if ( nodeId != null ) assertTrue("Converted NodeId but datatype test was false", b) ; if ( correct == null ) { assertNull("Expected no encoding: got: "+nodeId, nodeId) ; return ; } assertNotNull("Expected inlining: "+n, nodeId) ; Node n2 = NodeId.extract(nodeId) ; assertNotNull("Expected recovery", n2) ; String s = "("+correct.getLiteralLexicalForm()+","+n2.getLiteralLexicalForm()+")" ; assertTrue("Not same value: "+s, correct.sameValueAs(n2)) ; // Term equality. assertEquals("Not same term", correct, n2) ; } }
private void test(String x, Node correct) { Node n = NodeFactoryExtra.parseNode(x) ; NodeId nodeId = NodeId.inline(n) ; boolean b = NodeId.hasInlineDatatype(n) ; if ( nodeId != null ) assertTrue("Converted NodeId but datatype test was false", b) ; if ( correct == null ) { assertNull("Expected no encoding: got: "+nodeId, nodeId) ; return ; } assertNotNull("Expected inlining: "+n, nodeId) ; Node n2 = NodeId.extract(nodeId) ; assertNotNull("Expected recovery", n2) ; String s = "("+correct.getLiteralLexicalForm()+","+n2.getLiteralLexicalForm()+")" ; assertTrue("Not same value: "+s, correct.sameValueAs(n2)) ; // Term equality. assertEquals("Not same term", correct, n2) ; } }