/** * Parse a lexical form of this datatype to a value * @throws DatatypeFormatException if the lexical form is not legal */ @Override public Object parse(String lexicalForm) throws DatatypeFormatException { return new TypedValue(lexicalForm, getURI()); }
/** * Normalize the literal. If the value is narrower than the current data type * (e.g. value is xsd:date but the time is xsd:datetime) it will narrow * the type. If the type is narrower than the value then it may normalize * the value (e.g. set the mask of an XSDDateTime) */ protected void normalize() { if (dtype != null && value != null) { dtype = dtype.normalizeSubType(value, dtype); } }
/** * Compares two instances of values of the given datatype. * This default requires value and datatype equality. */ @Override public boolean isEqual(LiteralLabel litLabel1, LiteralLabel litLabel2) { return isEqualPlain(litLabel1, litLabel2) ; }
public static RDFDatatype getType(String s) { if ( s == null ) return null ; return TypeMapper.getInstance().getSafeTypeByName(s) ; }
public ExpressionCompiler(Collection<Element> elements, Function<VPath<?>, Var> pathHandler) {//PathVisitor<Expr> pathVisitor) { super(); //this.pathVisitor = pathVisitor; this.elements = elements; this.pathHandler = pathHandler; this.typeMapper = TypeMapper.getInstance(); }
/** Answer the datatype URI of this literal, null if it untyped. */ @Override public String getDatatypeURI() { if (dtype == null) return null; return dtype.getURI(); }
@Override public Class<?> getEntityClass() { return rdfDatatype.getJavaClass(); }
@Override public boolean isValid(String lexicalForm) { return delegate.isValid(lexicalForm); }
/** * Display format */ @Override public String toString() { return "Datatype[" + uri + (getJavaClass() == null ? "" : " -> " + getJavaClass()) + "]"; } }
/** * Test whether the given string is a legal lexical form * of this datatype. */ @Override public boolean isValid(String lexicalForm) { try { parse(lexicalForm); return true; } catch (DatatypeFormatException e) { return false; } }
public static RDFDatatype getType(String s) { if ( s == null ) return null ; return TypeMapper.getInstance().getSafeTypeByName(s) ; }
public ExpressionCompiler(Collection<Element> elements, Function<VPath<?>, Var> pathHandler) {//PathVisitor<Expr> pathVisitor) { super(); //this.pathVisitor = pathVisitor; this.elements = elements; this.pathHandler = pathHandler; this.typeMapper = TypeMapper.getInstance(); }
/** Answer the datatype URI of this literal, null if it untyped. */ @Override public String getDatatypeURI() { if (dtype == null) return null; return dtype.getURI(); }
@Override public Class<?> getJavaClass() { Class<?> result = dtype.getJavaClass(); return result; } }
/** * Parse a lexical form of this datatype to a value * @throws DatatypeFormatException if the lexical form is not legal */ @Override public Object parse(String lexicalForm) throws DatatypeFormatException { return new TypedValue(lexicalForm, getURI()); }
/** * Normalize the literal. If the value is narrower than the current data type * (e.g. value is xsd:date but the time is xsd:datetime) it will narrow * the type. If the type is narrower than the value then it may normalize * the value (e.g. set the mask of an XSDDateTime) */ protected void normalize() { if (dtype != null && value != null) { dtype = dtype.normalizeSubType(value, dtype); } }
/** * Compares two instances of values of the given datatype. * This default requires value and datatype equality. */ @Override public boolean isEqual(LiteralLabel litLabel1, LiteralLabel litLabel2) { return isEqualPlain(litLabel1, litLabel2) ; }
/** * Display format */ @Override public String toString() { return "Datatype[" + uri + (getJavaClass() == null ? "" : " -> " + getJavaClass()) + "]"; } }