ClassKey key = new ClassKey(rootType);
if (_rootNames == null) {
_rootNames = new LRUMap<ClassKey,SerializedString>(20, 200);
} else {
SerializedString name = _rootNames.get(key);
if (name != null) {
return name;
}
}
BeanDescription beanDesc = config.introspectClassAnnotations(rootType);
AnnotationIntrospector intr = config.getAnnotationIntrospector();
AnnotatedClass ac = beanDesc.getClassInfo();
PropertyName pname = intr.findRootName(ac);
String nameStr;
// No answer so far? Let's just default to using simple class name
if (pname == null || !pname.hasSimpleName()) {
// Should we strip out enclosing class tho? For now, nope:
nameStr = rootType.getSimpleName();
} else {
nameStr = pname.getSimpleName();
}
SerializedString name = new SerializedString(nameStr);
_rootNames.put(key, name);
return name;
}