Can\'t I register a bunch of XmlAdapters to Marshaller|Unmarshaller so that I wouldn\'t need to specify @XmlJavaTypeAdapter
You can use the package-info.java
That's called "package level".
Example : put a package-info.java in the same package that the class you want to marshall/unmarshall.
Suppose you have a class mypackage.model.A and an adapter CalendarAdapter in mypackage.adapter. Declare a package-info.java file in mypackage.model containing :
@XmlJavaTypeAdapters({
@XmlJavaTypeAdapter(value = CalendarAdapter.class, type = Calendar.class)
})
package mypackage.model;
import java.util.Calendar;
import mypackage.adapter.CalendarAdapter;
All field of type Calendar in the class A will be marshalled or unmarshalled with the CalendarAdapter.
You can find useful informations there : http://blog.bdoughan.com/2012/02/jaxb-and-package-level-xmladapters.html