@Test public void testGetInt() { String ns = "http: ModelWrapper mw = modelWrapperFixture(); Resource foo = mw.getModel().getResource( ns + "foo" ); CommonNodeWrapper n = new CommonNodeWrapper( mw, foo ); assertEquals( 42, n.getInt( mw.getModel().getProperty( ns+"p" ), -1 ) ); assertEquals( 42, n.getInt( ns+"p", -1 ) ); assertEquals( 42, n.getInt( "example:p", -1 ) ); assertEquals( -123, n.getInt( "example:not-here", -123 ) ); CommonNodeWrapper l = new CommonNodeWrapper( mw, mw.getModel().createLiteral( "kermit" ) ); assertEquals( -1, l.getInt( "example:foo", -1 )); assertEquals( -111, n.getInt( "example:q", -111 )); }
public int getInt( Object p, int def ) { int v = def; if (isResource()) { com.epimorphics.rdfutil.RDFNodeWrapper n = getPropertyValue( p ); if (n != null && n.isLiteral()) { try { v = n.asLiteral().getInt(); } catch (DatatypeFormatException e) { } } } return v; }
CommonNodeWrapper extends RDFNodeWrapper { public int getInt( Object p, int def ) { int v = def; if (isResource()) { com.epimorphics.rdfutil.RDFNodeWrapper n = getPropertyValue( p ); if (n != null && n.isLiteral()) { try { v = n.asLiteral().getInt(); } catch (DatatypeFormatException e) { } } } return v; } }
CommonNodeWrapper extends RDFNodeWrapper { public int getInt( Object p, int def ) { int v = def; if (isResource()) { com.epimorphics.rdfutil.RDFNodeWrapper n = getPropertyValue( p ); if (n != null && n.isLiteral()) { try { v = n.asLiteral().getInt(); } catch (DatatypeFormatException e) { } } } return v; } CommonNodeWrapper( ModelWrapper mw, RDFNode node );  CommonNodeWrapper( Page page, RDFNode node ); }
CommonNodeWrapper extends RDFNodeWrapper { public int getInt( Object p, int def ) { int v = def; if (isResource()) { com.epimorphics.rdfutil.RDFNodeWrapper n = getPropertyValue( p ); if (n != null && n.isLiteral()) { try { v = n.asLiteral().getInt(); } catch (DatatypeFormatException e) { } } } return v; } CommonNodeWrapper( ModelWrapper mw, RDFNode node );  CommonNodeWrapper( Page page, RDFNode node ); Page page(); int getInt( Object p, int def ); Resource getResource( Object p ); boolean isXmlLiteral(); @Override String getName(); }
CommonNodeWrapper extends RDFNodeWrapper { public int getInt( Object p, int def ) { int v = def; if (isResource()) { com.epimorphics.rdfutil.RDFNodeWrapper n = getPropertyValue( p ); if (n != null && n.isLiteral()) { try { v = n.asLiteral().getInt(); } catch (DatatypeFormatException e) { } } } return v; } CommonNodeWrapper( ModelWrapper mw, RDFNode node );  CommonNodeWrapper( Page page, RDFNode node ); Page page(); int getInt( Object p, int def ); Resource getResource( Object p ); boolean isXmlLiteral(); @Override String getName();  }