Search in sources :

Example 1 with TypeEncodingException

use of org.calrissian.mango.types.exception.TypeEncodingException in project incubator-rya by apache.

the class DateTimeRyaTypeResolver method serializeData.

@Override
protected String serializeData(String data) throws RyaTypeResolverException {
    try {
        DateTime dateTime = DateTime.parse(data, XMLDATETIME_PARSER);
        Date value = dateTime.toDate();
        return DATE_STRING_TYPE_ENCODER.encode(value);
    } catch (TypeEncodingException e) {
        throw new RyaTypeResolverException("Exception occurred serializing data[" + data + "]", e);
    }
}
Also used : TypeEncodingException(org.calrissian.mango.types.exception.TypeEncodingException) RyaTypeResolverException(org.apache.rya.api.resolver.RyaTypeResolverException) DateTime(org.joda.time.DateTime) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 RyaTypeResolverException (org.apache.rya.api.resolver.RyaTypeResolverException)1 TypeEncodingException (org.calrissian.mango.types.exception.TypeEncodingException)1 DateTime (org.joda.time.DateTime)1