private Root wrapObjectInXMLRoot(JAXBElement wrapperElement, Object value, TypeMappingInfo typeMappingInfo) { Root xmlroot = new Root(); Object objectValue = value; xmlroot.setObject(objectValue); QName qname = wrapperElement.getName(); xmlroot.setLocalName(qname.getLocalPart()); xmlroot.setNamespaceURI(qname.getNamespaceURI()); xmlroot.setDeclaredType(wrapperElement.getDeclaredType()); if(typeMappingInfo != null){ xmlroot.setSchemaType(typeMappingInfo.getSchemaType()); } else if(value != null) { if (value.getClass() == CoreClassConstants.ABYTE || value.getClass() == CoreClassConstants.APBYTE || value.getClass().getCanonicalName().equals("javax.activation.DataHandler")) { xmlroot.setSchemaType(Constants.BASE_64_BINARY_QNAME); } } return xmlroot; }
private Root wrapObjectInXMLRoot(JAXBElement wrapperElement, Object value, TypeMappingInfo typeMappingInfo) { Root xmlroot = new Root(); Object objectValue = value; xmlroot.setObject(objectValue); QName qname = wrapperElement.getName(); xmlroot.setLocalName(qname.getLocalPart()); xmlroot.setNamespaceURI(qname.getNamespaceURI()); xmlroot.setDeclaredType(wrapperElement.getDeclaredType()); if(typeMappingInfo != null){ xmlroot.setSchemaType(typeMappingInfo.getSchemaType()); } else if(value != null) { if (value.getClass() == CoreClassConstants.ABYTE || value.getClass() == CoreClassConstants.APBYTE || value.getClass().getCanonicalName().equals("javax.activation.DataHandler")) { xmlroot.setSchemaType(Constants.BASE_64_BINARY_QNAME); } } return xmlroot; }
private void setDeclaredTypeOnXMLRoot(Root xmlRoot, String elementNamespaceUri, String elementLocalName, boolean isNamespaceAware, Unmarshaller unmarshaller){ XPathQName xpathQName = new XPathQName(elementNamespaceUri, elementLocalName, isNamespaceAware); Descriptor desc = unmarshaller.getContext().getDescriptor(xpathQName); if(desc != null){ xmlRoot.setDeclaredType(desc.getJavaClass()); } }
private void setDeclaredTypeOnXMLRoot(Root xmlRoot, String elementNamespaceUri, String elementLocalName, boolean isNamespaceAware, Unmarshaller unmarshaller){ XPathQName xpathQName = new XPathQName(elementNamespaceUri, elementLocalName, isNamespaceAware); Descriptor desc = unmarshaller.getContext().getDescriptor(xpathQName); if(desc != null){ xmlRoot.setDeclaredType(desc.getJavaClass()); } }
public Object convertObjectValueToDataValue(Object objectValue, Session session, XMLMarshaller marshaller) { if(null != nestedConverter) { objectValue = nestedConverter.convertObjectValueToDataValue(objectValue, session, marshaller); } if(objectValue instanceof JAXBElement) { ClassDescriptor desc = session.getDescriptor(objectValue); if(desc == null || objectValue instanceof WrappedValue){ JAXBElement element = (JAXBElement) objectValue; Root root = new XMLRoot(); root.setLocalName(element.getName().getLocalPart()); root.setNamespaceURI(element.getName().getNamespaceURI()); root.setObject(element.getValue()); root.setDeclaredType(element.getDeclaredType()); root.setNil(element.isNil()); return root; } } return objectValue; }
@Override public Object convertObjectValueToDataValue(Object objectValue, Session session, XMLMarshaller marshaller) { if(null != nestedConverter) { objectValue = nestedConverter.convertObjectValueToDataValue(objectValue, session, marshaller); } if(objectValue instanceof JAXBElement) { ClassDescriptor desc = session.getDescriptor(objectValue); if(desc == null || objectValue instanceof WrappedValue){ JAXBElement element = (JAXBElement) objectValue; Root root = new XMLRoot(); root.setLocalName(element.getName().getLocalPart()); root.setNamespaceURI(element.getName().getNamespaceURI()); root.setObject(element.getValue()); root.setDeclaredType(element.getDeclaredType()); root.setNil(element.isNil()); return root; } } return objectValue; }
xmlroot.setLocalName(qname.getLocalPart()); xmlroot.setNamespaceURI(qname.getNamespaceURI()); xmlroot.setDeclaredType(elt.getDeclaredType()); xmlroot.setNil(elt.isNil()); if (elt.getDeclaredType() == CoreClassConstants.ABYTE || elt.getDeclaredType() == CoreClassConstants.APBYTE ||
xmlroot.setLocalName(qname.getLocalPart()); xmlroot.setNamespaceURI(qname.getNamespaceURI()); xmlroot.setDeclaredType(elt.getDeclaredType()); xmlroot.setNil(elt.isNil()); if (elt.getDeclaredType() == CoreClassConstants.ABYTE || elt.getDeclaredType() == CoreClassConstants.APBYTE ||