All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.bingads.internal.restful.adaptor.CalendarSerializer Maven / Gradle / Ivy

Go to download

The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.

There is a newer version: 13.0.22.1
Show newest version
package com.microsoft.bingads.internal.restful.adaptor;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;


public class CalendarSerializer extends StdSerializer {
	
	private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
	
	public CalendarSerializer() {
		this(null);
	}
	
    public CalendarSerializer(Class t) {
    	super(t);
    }

	@Override
	public void serialize(Calendar value, JsonGenerator gen, SerializerProvider provider) throws IOException {
		gen.writeString(jakarta.xml.bind.DatatypeConverter.printDateTime(value));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy