GeometryDatatype extends BaseDatatype { public static final GeometryDatatype get(RDFDatatype rdfDatatype) throws DatatypeFormatException { if (rdfDatatype instanceof GeometryDatatype) { return (GeometryDatatype) rdfDatatype; } else { throw new DatatypeFormatException("Unrecognised Geometry Datatype: " + rdfDatatype.getURI() + " Ensure that Datatype is extending GeometryDatatype."); } } GeometryDatatype(String uri); abstract GeometryWrapper read(String geometryLiteral); @Override final GeometryWrapper parse(String lexicalForm); final GeometryWrapper parse(String lexicalForm, GeometryIndex targetIndex); static final void registerDatatypes(); static final GeometryDatatype get(RDFDatatype rdfDatatype); static final GeometryDatatype get(String datatypeURI); static final boolean checkURI(String datatypeURI); static final boolean check(RDFDatatype rdfDatatype);  }
@Test public void testGetGeometryDatatype_RDFDatatype() { RDFDatatype rdfDatatype = WKTDatatype.INSTANCE; GeometryDatatype expResult = WKTDatatype.INSTANCE; GeometryDatatype result = GeometryDatatype.get(rdfDatatype); assertEquals(expResult, result); }
@Test(expected = DatatypeFormatException.class) public void testGetGeometryDatatype_RDFDatatype_Fail() { RDFDatatype rdfDatatype = XSDDatatype.XSDdouble; GeometryDatatype.get(rdfDatatype); fail("Exception not thrown when expected."); }
@Test public void testGetGeometryDatatype_String() { String datatypeURI = WKTDatatype.URI; GeometryDatatype expResult = WKTDatatype.INSTANCE; GeometryDatatype result = GeometryDatatype.get(datatypeURI); assertEquals(expResult, result); }