@Override
 public PropertyName findRootName(AnnotatedClass ac) {
   JsonRootName ann = _findAnnotation(ac, JsonRootName.class);
   if (ann == null) {
     return null;
   }
   String ns = ann.namespace();
   if (ns != null && ns.length() == 0) {
     ns = null;
   }
   return PropertyName.construct(ann.value(), ns);
 }
Esempio n. 2
0
 private static String rootNameFor(Class<?> type) {
   JsonRootName rootName = type.getAnnotation(JsonRootName.class);
   return rootName == null ? type.getSimpleName() : rootName.value();
 }