Object nameObj = componentName;
if (nameObj != null) {
try {
pd.getWriteMethod().invoke(bean, new Object[] { nameObj });
} catch (Throwable e) {
throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
}
}
} else {
throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
}