@Override public Datatype<?> getPrimitiveDatatype() { return XSDDecimal.getInstance(); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { if (!ATermUtils.isLiteral(input)) throw new IllegalArgumentException(); if (!input.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(input); try { DatatypeConverter.parseInteger(lexicalForm); } catch (final NumberFormatException e) { _logger.severe(format("Number format exception (%s) cause while parsing integer %s", e.getMessage(), lexicalForm)); throw new InvalidLiteralException(name, lexicalForm); } return XSDDecimal.getInstance().getCanonicalRepresentation(ATermUtils.makeTypedLiteral(lexicalForm, XSDDecimal.getInstance().getName())); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { if (!ATermUtils.isLiteral(input)) throw new IllegalArgumentException(); if (!input.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(input); try { DatatypeConverter.parseLong(lexicalForm); } catch (final NumberFormatException e) { _logger.severe(format("Number format exception (%s) cause while parsing long %s", e.getMessage(), lexicalForm)); throw new InvalidLiteralException(name, lexicalForm); } return XSDDecimal.getInstance().getCanonicalRepresentation(ATermUtils.makeTypedLiteral(lexicalForm, XSDDecimal.getInstance().getName())); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { if (!ATermUtils.isLiteral(input)) throw new IllegalArgumentException(); if (!input.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(input); try { DatatypeConverter.parseInteger(lexicalForm); } catch (final NumberFormatException e) { _logger.severe(format("Number format exception (%s) cause while parsing integer %s", e.getMessage(), lexicalForm)); throw new InvalidLiteralException(name, lexicalForm); } return XSDDecimal.getInstance().getCanonicalRepresentation(ATermUtils.makeTypedLiteral(lexicalForm, XSDDecimal.getInstance().getName())); }
@Override public Datatype<?> getPrimitiveDatatype() { return XSDDecimal.getInstance(); }
@Override public ATermAppl getCanonicalRepresentation(final ATermAppl input) throws InvalidLiteralException { if (!ATermUtils.isLiteral(input)) throw new IllegalArgumentException(); if (!input.getArgument(ATermUtils.LIT_URI_INDEX).equals(name)) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue(input); try { DatatypeConverter.parseLong(lexicalForm); } catch (final NumberFormatException e) { _logger.severe(format("Number format exception (%s) cause while parsing long %s", e.getMessage(), lexicalForm)); throw new InvalidLiteralException(name, lexicalForm); } return XSDDecimal.getInstance().getCanonicalRepresentation(ATermUtils.makeTypedLiteral(lexicalForm, XSDDecimal.getInstance().getName())); }
@Override public Datatype<?> getPrimitiveDatatype() { return XSDDecimal.getInstance(); }
@Override public Datatype<?> getPrimitiveDatatype() { return XSDDecimal.getInstance(); }