ObjectMapper mapper = null;
if (cls != null) {
// Workaround for http://jira.codehaus.org/browse/JACKSON-413
Package pkg = cls.getPackage();
if (pkg != null) {
XmlJavaTypeAdapters adapters = pkg.getAnnotation(XmlJavaTypeAdapters.class);
if (adapters != null) {
CustomSerializerFactory serializerFactory = new CustomSerializerFactory();
BeanDeserializerFactory deserializerFactory = new BeanDeserializerFactory(null);
for (XmlJavaTypeAdapter a : adapters.value()) {
XmlAdapter xmlAdapter = null;
try {
xmlAdapter = a.value().newInstance();
} catch (Throwable e) {
// Ignore