private PhotoFacetFinderStrategy getPhotoFacetFinderStrategyFromObjectType(final ObjectType objectType) {
if (objectType != null) {
try {
final Class<? extends AbstractFacet> facetClass = objectType.facetClass();
final ObjectTypeSpec objectTypeSpec = facetClass.getAnnotation(ObjectTypeSpec.class);
final Class<? extends PhotoFacetFinderStrategy> photoFacetFinderStrategyClass = objectTypeSpec.photoFacetFinderStrategy();
return beanFactory.getBean(photoFacetFinderStrategyClass);
}
catch (Exception e) {
LOG.error("Exception caught while trying trying to instantiate the PhotoFacetFinderStrategy from objectType [" + objectType + "]. Returning null.", e);
}