gson-compile/gson-compile-core/src/main/java/io/gitlab/jfronny/gson/compile/core/CCore.java

22 lines
672 B
Java

package io.gitlab.jfronny.gson.compile.core;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolder;
import io.gitlab.jfronny.gson.JsonSyntaxException;
import io.gitlab.jfronny.gson.internal.bind.util.ISO8601Utils;
import java.text.ParseException;
import java.text.ParsePosition;
import java.util.Date;
public class CCore {
public static final GsonHolder HOLDER = new GsonHolder();
public static Date parseDate(String date) {
try {
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonSyntaxException("Failed parsing '" + date + "' as Date", e);
}
}
}