XsdBoolean extends Datatype<Boolean> { public String getCanonicalRepresentation() { if(_b) return "true"; return "false"; } XsdBoolean(String s); Boolean getValue(); String getCanonicalRepresentation(); static final Resource DT; }
@Test public void canonicalisationTest() throws DatatypeParseException { assertEquals("true", new XsdBoolean("true").getCanonicalRepresentation()); assertEquals("false", new XsdBoolean("false").getCanonicalRepresentation()); assertEquals("true", new XsdBoolean("1").getCanonicalRepresentation()); assertEquals("false", new XsdBoolean("0").getCanonicalRepresentation()); }