@Override public ATermAppl getCanonicalRepresentation(final ATermAppl literal) throws InvalidLiteralException, UnrecognizedDatatypeException { final ATermAppl dtName = getDatatypeName(literal); final Datatype<?> dt = getDatatype(dtName); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING) { case INFINITE_STRING: return literal; case EMPTY: throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal)); case EXCEPTION: throw new UnrecognizedDatatypeException(dtName); default: throw new IllegalStateException(); } else return dt.getCanonicalRepresentation(literal); }
@Override public boolean validLiteral(final ATermAppl typedLiteral) throws UnrecognizedDatatypeException { if (!ATermUtils.isLiteral(typedLiteral)) throw new IllegalArgumentException(); final ATermAppl dtTerm = (ATermAppl) typedLiteral.getArgument(ATermUtils.LIT_URI_INDEX); if (dtTerm == null) throw new IllegalArgumentException(); final Datatype<?> dt = getDatatype(dtTerm); if (dt == null) throw new UnrecognizedDatatypeException(dtTerm); try { dt.getValue(typedLiteral); } catch (final InvalidLiteralException e) { _logger.log(Level.FINE, "", e); return false; } return true; }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl literal) throws InvalidLiteralException, UnrecognizedDatatypeException { final ATermAppl dtName = getDatatypeName(literal); final Datatype<?> dt = getDatatype(dtName); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING) { case INFINITE_STRING: return literal; case EMPTY: throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal)); case EXCEPTION: throw new UnrecognizedDatatypeException(dtName); default: throw new IllegalStateException(); } else return dt.getCanonicalRepresentation(literal); }
@Override public boolean validLiteral(final ATermAppl typedLiteral) throws UnrecognizedDatatypeException { if (!ATermUtils.isLiteral(typedLiteral)) throw new IllegalArgumentException(); final ATermAppl dtTerm = (ATermAppl) typedLiteral.getArgument(ATermUtils.LIT_URI_INDEX); if (dtTerm == null) throw new IllegalArgumentException(); final Datatype<?> dt = getDatatype(dtTerm); if (dt == null) throw new UnrecognizedDatatypeException(dtTerm); try { dt.getValue(typedLiteral); } catch (final InvalidLiteralException e) { _logger.log(Level.FINE, "", e); return false; } return true; }
@Override public Object getValue(final ATermAppl literal) throws InvalidLiteralException, UnrecognizedDatatypeException { final ATermAppl dtName = getDatatypeName(literal); final Datatype<?> dt = getDatatype(dtName); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING) { case INFINITE_STRING: return literal; case EMPTY: throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal)); case EXCEPTION: throw new UnrecognizedDatatypeException(dtName); default: throw new IllegalStateException(); } else return dt.getValue(literal); }
Datatype<?> dt = getDatatype(a); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING)
@Override public Object getValue(final ATermAppl literal) throws InvalidLiteralException, UnrecognizedDatatypeException { final ATermAppl dtName = getDatatypeName(literal); final Datatype<?> dt = getDatatype(dtName); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING) { case INFINITE_STRING: return literal; case EMPTY: throw new InvalidLiteralException(dtName, ATermUtils.getLiteralValue(literal)); case EXCEPTION: throw new UnrecognizedDatatypeException(dtName); default: throw new IllegalStateException(); } else return dt.getValue(literal); }
Datatype<?> dt = getDatatype(a); if (dt == null) switch (OpenlletOptions.UNDEFINED_DATATYPE_HANDLING)