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

javax.xml.bind.TemporalAdapter Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
package javax.xml.bind;

import java.time.format.DateTimeFormatter;
import java.time.temporal.Temporal;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public abstract class TemporalAdapter extends XmlAdapter {
	
	DateTimeFormatter formatter;
	
	public TemporalAdapter(DateTimeFormatter f) {
		formatter = f;
	}

	@Override
	public String marshal(T v) throws Exception {
		if(v==null) return null;
		else return formatter.format(v);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy