public final class SimpleDateFormatUtil {
+ /**
+ * revision format according to Yang spec.
+ */
+ private static final String REVISION_SIMPLE_DATE = "yyyy-MM-dd";
+
private SimpleDateFormatUtil() {
throw new UnsupportedOperationException("Utility class should not be instantiated");
}
@Override
protected SimpleDateFormat initialValue() {
- return new SimpleDateFormat("yyyy-MM-dd");
+ final SimpleDateFormat fmt = new SimpleDateFormat(REVISION_SIMPLE_DATE);
+ fmt.setLenient(false);
+ return fmt;
}
@Override
- public void set(SimpleDateFormat value) {
+ public void set(final SimpleDateFormat value) {
throw new UnsupportedOperationException();
}