private QName _qname(PropertyName n) { String ns = n.getNamespace(); if (ns == null) { ns = ""; } return new QName(ns, n.getSimpleName()); }
private QName _qname(PropertyName n) { String ns = n.getNamespace(); if (ns == null) { ns = ""; } return new QName(ns, n.getSimpleName()); }
protected QName _rootNameFromConfig() { PropertyName name = _config.getFullRootName(); if (name == null) { return null; } String ns = name.getNamespace(); if (ns == null || ns.isEmpty()) { return new QName(name.getSimpleName()); } return new QName(ns, name.getSimpleName()); }
protected QName _rootNameFromConfig() { PropertyName name = _config.getFullRootName(); if (name == null) { return null; } String ns = name.getNamespace(); if (ns == null || ns.isEmpty()) { return new QName(name.getSimpleName()); } return new QName(ns, name.getSimpleName()); }
protected QName _findRootName(Class<?> rootType, MapperConfig<?> config) { BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); String localName = null; String ns = null; PropertyName root = intr.findRootName(ac); if (root != null) { localName = root.getSimpleName(); ns = root.getNamespace(); } // No answer so far? Let's just default to using simple class name if (localName == null || localName.length() == 0) { // Should we strip out enclosing class tho? For now, nope: // one caveat: array simple names end with "[]"; also, "$" needs replacing localName = StaxUtil.sanitizeXmlTypeName(rootType.getSimpleName()); return new QName("", localName); } // Otherwise let's see if there's namespace, too (if we are missing it) if (ns == null || ns.length() == 0) { ns = findNamespace(intr, ac); } if (ns == null) { // some QName impls barf on nulls... ns = ""; } return new QName(ns, localName); }
protected QName _findRootName(Class<?> rootType, MapperConfig<?> config) { BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); String localName = null; String ns = null; PropertyName root = intr.findRootName(ac); if (root != null) { localName = root.getSimpleName(); ns = root.getNamespace(); } // No answer so far? Let's just default to using simple class name if (localName == null || localName.length() == 0) { // Should we strip out enclosing class tho? For now, nope: // one caveat: array simple names end with "[]"; also, "$" needs replacing localName = StaxUtil.sanitizeXmlTypeName(rootType.getSimpleName()); return new QName("", localName); } // Otherwise let's see if there's namespace, too (if we are missing it) if (ns == null || ns.length() == 0) { ns = findNamespace(intr, ac); } if (ns == null) { // some QName impls barf on nulls... ns = ""; } return new QName(ns, localName); }