protected QName getCollectionWrapperQName(Class<?> cls, Type type, Object object, boolean pluralName) throws Exception { String name = getCollectionWrapperName(cls); if (name == null) { return getJaxbQName(cls, type, object, pluralName); } return JAXRSUtils.convertStringToQName(name); }
protected QName getCollectionWrapperQName(Class<?> cls, Type type, Object object, boolean pluralName) throws Exception { String name = getCollectionWrapperName(cls); if (name == null) { return getJaxbQName(cls, type, object, pluralName); } return JAXRSUtils.convertStringToQName(name); }
@SuppressWarnings({ "unchecked", "rawtypes" }) protected Object convertToJaxbElementIfNeeded(Object obj, Class<?> cls, Type genericType) throws Exception { Class<?> jaxbElementCls = jaxbElementClassNames == null ? null : getJaxbElementClass(cls); boolean asJaxbElement = jaxbElementCls != null; if (!asJaxbElement && isXmlRoot(cls) && !xmlRootAsJaxbElement) { return obj; } if (jaxbElementCls == null) { jaxbElementCls = cls; } QName name = null; String expandedName = jaxbElementClassMap.get(jaxbElementCls.getName()); if (expandedName != null) { name = JAXRSUtils.convertStringToQName(expandedName); } else if (marshalAsJaxbElement || asJaxbElement) { name = getJaxbQName(jaxbElementCls, genericType, obj, false); } return name != null ? new JAXBElement<Object>(name, (Class)jaxbElementCls, null, obj) : obj; }
@SuppressWarnings({ "unchecked", "rawtypes" }) protected Object convertToJaxbElementIfNeeded(Object obj, Class<?> cls, Type genericType) throws Exception { Class<?> jaxbElementCls = jaxbElementClassNames == null ? null : getJaxbElementClass(cls); boolean asJaxbElement = jaxbElementCls != null; if (!asJaxbElement && isXmlRoot(cls)) { return obj; } if (jaxbElementCls == null) { jaxbElementCls = cls; } QName name = null; String expandedName = jaxbElementClassMap.get(jaxbElementCls.getName()); if (expandedName != null) { name = JAXRSUtils.convertStringToQName(expandedName); } else if (marshalAsJaxbElement || asJaxbElement) { name = getJaxbQName(jaxbElementCls, genericType, obj, false); } return name != null ? new JAXBElement<Object>(name, (Class)jaxbElementCls, null, obj) : obj; }