private static XMLGregorianCalendar dateTime(final String s) { return RestrictedTimelineDatatype.getDatatypeFactory().newXMLGregorianCalendar(s); }
@Override public Duration getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { final Duration c = getDatatypeFactory().newDuration(lexicalForm); return c; } catch (final IllegalArgumentException e) { /* * newXMLGregorianCalendar will throw an IllegalArgumentException if * the lexical form is not one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } catch (final IllegalStateException e) { /* * getXMLSchemaType will throw an IllegalStateException if the * combination of fields set in the calendar object doesn't match * one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } }
@Override public Duration getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { final Duration c = getDatatypeFactory().newDuration(lexicalForm); return c; } catch (final IllegalArgumentException e) { /* * newXMLGregorianCalendar will throw an IllegalArgumentException if * the lexical form is not one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } catch (final IllegalStateException e) { /* * getXMLSchemaType will throw an IllegalStateException if the * combination of fields set in the calendar object doesn't match * one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } }
@Override public XMLGregorianCalendar getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { final XMLGregorianCalendar c = getDatatypeFactory().newXMLGregorianCalendar(lexicalForm); if (!_schemaType.equals(c.getXMLSchemaType())) throw new InvalidLiteralException(getName(), lexicalForm); return c; } catch (final IllegalArgumentException e) { /* * newXMLGregorianCalendar will throw an IllegalArgumentException if * the lexical form is not one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } catch (final IllegalStateException e) { /* * getXMLSchemaType will throw an IllegalStateException if the * combination of fields set in the calendar object doesn't match * one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } }
@Override public XMLGregorianCalendar getValue(final ATermAppl literal) throws InvalidLiteralException { final String lexicalForm = getLexicalForm(literal); try { final XMLGregorianCalendar c = getDatatypeFactory().newXMLGregorianCalendar(lexicalForm); if (!_schemaType.equals(c.getXMLSchemaType())) throw new InvalidLiteralException(getName(), lexicalForm); return c; } catch (final IllegalArgumentException e) { /* * newXMLGregorianCalendar will throw an IllegalArgumentException if * the lexical form is not one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } catch (final IllegalStateException e) { /* * getXMLSchemaType will throw an IllegalStateException if the * combination of fields set in the calendar object doesn't match * one of the XML Schema datetime types */ throw new InvalidLiteralException(getName(), lexicalForm, e); } }