com.cognitect.transit.impl.AbstractParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transit-java Show documentation
Show all versions of transit-java Show documentation
Transit is a data format and a set of libraries for conveying values between applications written in different languages. This library provides support for marshalling Transit data to/from Java.
// Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit.impl;
import com.cognitect.transit.ArrayReader;
import com.cognitect.transit.DefaultReadHandler;
import com.cognitect.transit.MapReader;
import com.cognitect.transit.ReadHandler;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
public abstract class AbstractParser implements Parser {
private static final ThreadLocal dateTimeFormat =
new ThreadLocal() {
@Override protected SimpleDateFormat initialValue() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
sdf.setTimeZone(java.util.TimeZone.getTimeZone("UTC"));
return sdf;
}
};
public static SimpleDateFormat getDateTimeFormat() {
return dateTimeFormat.get();
}
protected final Map> handlers;
private final DefaultReadHandler> defaultHandler;
protected MapReader