Top Description Fields Constructors Methods
org.mortbay.util.ajax

public Class JSONDateConvertor

extends Object
implements Convertor
Class Inheritance
All Implemented Interfaces
org.mortbay.util.ajax.JSON.Convertor
Imports
java.text.DateFormatSymbols, .SimpleDateFormat, java.util.Date, .Locale, .Map, .TimeZone, org.mortbay.log.Log, org.mortbay.util.DateCache, org.mortbay.util.ajax.JSON.Output

Convert a Date 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.

Field Summary

Modifier and TypeField and Description
pack-priv DateCache
pack-priv SimpleDateFormat
private boolean

Constructor Summary

AccessConstructor and Description
public
public
JSONDateConvertor(boolean fromJSON)

public
JSONDateConvertor(String format, TimeZone zone, boolean fromJSON)

public
JSONDateConvertor(String format, TimeZone zone, boolean fromJSON, Locale locale)

Method Summary

Modifier and TypeMethod and Description
public Object
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_dateCacheback to summary
pack-priv DateCache _dateCache
_formatback to summary
pack-priv SimpleDateFormat _format
_fromJSONback to summary
private boolean _fromJSON

Constructor Detail

JSONDateConvertorback to summary
public JSONDateConvertor()
JSONDateConvertorback to summary
public JSONDateConvertor(boolean fromJSON)
JSONDateConvertorback to summary
public JSONDateConvertor(String format, TimeZone zone, boolean fromJSON)
JSONDateConvertorback to summary
public JSONDateConvertor(String format, TimeZone zone, boolean fromJSON, Locale locale)

Method Detail

fromJSONback to summary
public Object fromJSON(Map<K, V> map)

Implements org.mortbay.util.ajax.JSON.Convertor.fromJSON.

toJSONback to summary
public void toJSON(Object obj, JSON.Output out)

Implements org.mortbay.util.ajax.JSON.Convertor.toJSON.