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; }
protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ if (!xmlAnyObjectMapping.usesXMLRoot()) { unmarshalRecord.setAttributeValue(value, xmlAnyObjectMapping); } else { Root xmlRoot = unmarshalRecord.createRoot(); xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI()); xmlRoot.setSchemaType(unmarshalRecord.getTypeQName()); xmlRoot.setLocalName(xPathFragment.getLocalName()); xmlRoot.setObject(value); // xmlRoot.setDeclaredType(type); unmarshalRecord.setAttributeValue(xmlRoot, xmlAnyObjectMapping); } }
protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ if (!xmlAnyObjectMapping.usesXMLRoot()) { unmarshalRecord.setAttributeValue(value, xmlAnyObjectMapping); } else { Root xmlRoot = unmarshalRecord.createRoot(); xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI()); xmlRoot.setSchemaType(unmarshalRecord.getTypeQName()); xmlRoot.setLocalName(xPathFragment.getLocalName()); xmlRoot.setObject(value); // xmlRoot.setDeclaredType(type); unmarshalRecord.setAttributeValue(xmlRoot, xmlAnyObjectMapping); } }
xmlroot.setSchemaType(Constants.BASE_64_BINARY_QNAME); xmlroot.setSchemaType((QName) org.eclipse.persistence.internal.oxm.XMLConversionManager.getDefaultJavaTypes().get(elt.getDeclaredType()));
xmlroot.setSchemaType(Constants.BASE_64_BINARY_QNAME); xmlroot.setSchemaType((QName) org.eclipse.persistence.internal.oxm.XMLConversionManager.getDefaultJavaTypes().get(elt.getDeclaredType()));
protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ if (!xmlAnyCollectionMapping.usesXMLRoot() || xPathFragment.getLocalName() == null || (xmlAnyCollectionMapping.isMixedContent() && unmarshalRecord.getTextWrapperFragment() != null && unmarshalRecord.getTextWrapperFragment().equals(xPathFragment))) { unmarshalRecord.addAttributeValue(this, value); } else { Root xmlRoot = unmarshalRecord.createRoot(); xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI()); xmlRoot.setSchemaType(unmarshalRecord.getTypeQName()); xmlRoot.setLocalName(xPathFragment.getLocalName()); xmlRoot.setObject(value); unmarshalRecord.addAttributeValue(this, xmlRoot); } }
protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ if (!xmlAnyCollectionMapping.usesXMLRoot() || xPathFragment.getLocalName() == null || (xmlAnyCollectionMapping.isMixedContent() && unmarshalRecord.getTextWrapperFragment() != null && unmarshalRecord.getTextWrapperFragment().equals(xPathFragment))) { unmarshalRecord.addAttributeValue(this, value); } else { Root xmlRoot = unmarshalRecord.createRoot(); xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI()); xmlRoot.setSchemaType(unmarshalRecord.getTypeQName()); xmlRoot.setLocalName(xPathFragment.getLocalName()); xmlRoot.setObject(value); unmarshalRecord.addAttributeValue(this, xmlRoot); } }