You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
708 B
27 lines
708 B
package de.timroes.axmlrpc.serializer; |
|
|
|
import de.timroes.axmlrpc.XMLUtil; |
|
import de.timroes.axmlrpc.xmlcreator.XmlElement; |
|
import java.text.SimpleDateFormat; |
|
|
|
/** |
|
* |
|
* @author timroes |
|
*/ |
|
public class DateTimeSerializer implements Serializer { |
|
|
|
public static final String DATETIME_FORMAT = "yyyyMMdd'T'HHmmss"; |
|
public static final SimpleDateFormat DATE_FORMATER = new SimpleDateFormat(DATETIME_FORMAT); |
|
|
|
public final boolean accepts_null_input; |
|
|
|
public DateTimeSerializer(boolean accepts_null_input) { |
|
this.accepts_null_input = accepts_null_input; |
|
} |
|
|
|
public XmlElement serialize(Object object) { |
|
return XMLUtil.makeXmlTag(SerializerHandler.TYPE_DATETIME, |
|
DATE_FORMATER.format(object)); |
|
} |
|
|
|
}
|
|
|