Package org.eclipse.jetty.util.ajax
Class JSONDateConvertor
- java.lang.Object
-
- org.eclipse.jetty.util.ajax.JSONDateConvertor
-
- All Implemented Interfaces:
JSON.Convertor
public class JSONDateConvertor extends java.lang.Object implements JSON.Convertor
Convert aDate
to JSON. If fromJSON is true in the constructor, the JSON generated will be of the form {class="java.util.Date",value="1/1/1970 12:00 GMT"} If fromJSON is false, then only the string value of the date is generated.
-
-
Constructor Summary
Constructors Constructor Description JSONDateConvertor()
JSONDateConvertor(boolean fromJSON)
JSONDateConvertor(java.lang.String format, java.util.TimeZone zone, boolean fromJSON)
JSONDateConvertor(java.lang.String format, java.util.TimeZone zone, boolean fromJSON, java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
fromJSON(java.util.Map map)
void
toJSON(java.lang.Object obj, JSON.Output out)
-
-
-
Constructor Detail
-
JSONDateConvertor
public JSONDateConvertor()
-
JSONDateConvertor
public JSONDateConvertor(boolean fromJSON)
-
JSONDateConvertor
public JSONDateConvertor(java.lang.String format, java.util.TimeZone zone, boolean fromJSON)
-
JSONDateConvertor
public JSONDateConvertor(java.lang.String format, java.util.TimeZone zone, boolean fromJSON, java.util.Locale locale)
-
-
Method Detail
-
fromJSON
public java.lang.Object fromJSON(java.util.Map map)
- Specified by:
fromJSON
in interfaceJSON.Convertor
-
toJSON
public void toJSON(java.lang.Object obj, JSON.Output out)
- Specified by:
toJSON
in interfaceJSON.Convertor
-
-