@Test public void testFromJson() { JsonNode jsonNode = JsonNodeFactory.withExactBigDecimals(false).textNode(new SimpleDateFormat(Constants.DATE_FORMAT_STR).format(new Date())); Object fromJson = dateType.fromJson(jsonNode); assertTrue(fromJson instanceof Date); }
@Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return Constants.getDateFormat().parse(node.asText()); } catch (ParseException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } }
DateType implements Type, Serializable { @Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return Constants.getDateFormat().parse(node.asText()); } catch (ParseException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } }
DateType implements Type, Serializable { @Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return Constants.getDateFormat().parse(node.asText()); } catch (ParseException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } private  DateType(); }
DateType implements Type, Serializable { @Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return Constants.getDateFormat().parse(node.asText()); } catch (ParseException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } private  DateType(); @Deprecated static DateFormat getDateFormat(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override Object cast(Object obj); @SuppressWarnings({"rawtypes", "unchecked"}) @Override int compare(Object v1, Object v2); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
DateType implements Type, Serializable { @Override public Object fromJson(JsonNode node) { if (node == null || node instanceof NullNode) { return null; } else if (node.isValueNode()) { try { return Constants.getDateFormat().parse(node.asText()); } catch (ParseException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, node.toString()); } } private  DateType(); @Deprecated static DateFormat getDateFormat(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override Object cast(Object obj); @SuppressWarnings({"rawtypes", "unchecked"}) @Override int compare(Object v1, Object v2); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); @Deprecated
    static final String DATE_FORMAT_STR; static final Type TYPE; static final String NAME; }