@Override protected AbstractSimpleType getSimpleTypeInstance() { return EdmTime.getInstance(); } }
@Override protected <T> T internalValueOfString(final String value, final EdmLiteralKind literalKind, final EdmFacets facets, final Class<T> returnType) throws EdmSimpleTypeException { Calendar valueCalendar; if (literalKind == EdmLiteralKind.URI) { if (value.length() > 6 && value.startsWith("time'") && value.endsWith("'")) { valueCalendar = parseLiteral(value.substring(5, value.length() - 1), facets); } else { throw new EdmSimpleTypeException(EdmSimpleTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)); } } else { valueCalendar = parseLiteral(value, facets); } if (returnType.isAssignableFrom(Calendar.class)) { return returnType.cast(valueCalendar); } else if (returnType.isAssignableFrom(Long.class)) { return returnType.cast(valueCalendar.getTimeInMillis()); } else if (returnType.isAssignableFrom(Date.class)) { return returnType.cast(valueCalendar.getTime()); } else { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)); } }
else if(EdmTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Calendar.class);
else if(EdmTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Long.class);
else if(EdmTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Date.class);
@Override @Nonnull protected AbstractSimpleType getODataTypeInstance() { return EdmTime.getInstance(); } }
return EdmString.getInstance(); case Time: return EdmTime.getInstance(); case Null: return EdmNull.getInstance();
return EdmString.getInstance(); case Time: return EdmTime.getInstance(); case Null: return EdmNull.getInstance();
return EdmString.getInstance(); case Time: return EdmTime.getInstance(); case Null: return EdmNull.getInstance();