String resourceName = resourceDefinition.name();
if (isBlank(resourceName)) {
Class<?> parent = theClass.getSuperclass();
primaryNameProvider = false;
while (parent.equals(Object.class) == false && isBlank(resourceName)) {
ResourceDef nextDef = parent.getAnnotation(ResourceDef.class);
if (nextDef != null) {
resourceName = nextDef.name();
}
parent = parent.getSuperclass();
}
if (isBlank(resourceName)) {
throw new ConfigurationException("Resource type @" + ResourceDef.class.getSimpleName() + " annotation contains no resource name(): " + theClass.getCanonicalName() + " - This is only allowed for types that extend other resource types ");