Catch an error condition.

This commit is contained in:
Jon Brisbin
2013-03-12 09:49:07 -05:00
committed by Jon Brisbin
parent fb1cf26fcc
commit df239e49ce

View File

@@ -109,7 +109,14 @@ public class PersistentEntityJackson2Module extends SimpleModule implements Init
@SuppressWarnings({"unchecked"})
@Override public void afterPropertiesSet() throws Exception {
for(Class<?> domainType : repositories) {
addDeserializer(domainType, new ResourceDeserializer(repositories.getPersistentEntity(domainType)));
PersistentEntity pe = repositories.getPersistentEntity(domainType);
if(null == pe) {
if(LOG.isWarnEnabled()) {
LOG.warn("The domain class {} does not have PersistentEntity metadata.", domainType.getName());
}
} else {
addDeserializer(domainType, new ResourceDeserializer(pe));
}
}
}
@@ -141,6 +148,7 @@ public class PersistentEntityJackson2Module extends SimpleModule implements Init
if(uriDomainClassConverter.matches(URI_TYPE, entityType)) {
entity = uriDomainClassConverter.convert(uri, URI_TYPE, entityType);
}
continue;
}