com.avaje.ebean.text.json
Interface JsonValueAdapter


public interface JsonValueAdapter

Allows you to customise the Date and Timestamp formats.

There is not a standard JSON format for Date or Timestamp types. By default Ebean uses ISO8601 "yyyy-MM-dd'T'HH:mm:ss.SSSZ" and "yyyy-MM-dd".

Note that Ebean will convert Joda types to either of the Date or Timestamp types and back for you.

Author:
rbygrave
See Also:
JsonReadOptions

Method Summary
 String jsonFromDate(Date date)
          Convert the Date to json string.
 String jsonFromTimestamp(Timestamp date)
          Convert the DateTime to json string.
 Date jsonToDate(String jsonDate)
          Parse the JSON string into a Date.
 Timestamp jsonToTimestamp(String jsonDateTime)
          Parse the JSON DateTime into a Timestamp.
 

Method Detail

jsonFromDate

String jsonFromDate(Date date)
Convert the Date to json string.


jsonFromTimestamp

String jsonFromTimestamp(Timestamp date)
Convert the DateTime to json string.


jsonToDate

Date jsonToDate(String jsonDate)
Parse the JSON string into a Date.


jsonToTimestamp

Timestamp jsonToTimestamp(String jsonDateTime)
Parse the JSON DateTime into a Timestamp.



Copyright © 2010. All Rights Reserved.