/** * INTERNAL: * @return */ public Object wrapObjectInXMLRoot(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, String encoding, String version, boolean forceWrap, boolean isNamespaceAware, XMLUnmarshaller unmarshaller) { if (forceWrap || shouldWrapObject(object, elementNamespaceUri, elementLocalName, elementPrefix, isNamespaceAware)) { // if the DOMRecord element != descriptor's default // root element, create an XMLRoot, populate and return it Root xmlRoot = new XMLRoot(); xmlRoot.setLocalName(elementLocalName); xmlRoot.setNamespaceURI(elementNamespaceUri); xmlRoot.setObject(object); xmlRoot.setEncoding(encoding); xmlRoot.setVersion(version); setDeclaredTypeOnXMLRoot(xmlRoot, elementNamespaceUri, elementLocalName, isNamespaceAware, unmarshaller); return xmlRoot; } return object; }
/** * INTERNAL: * @return */ public Object wrapObjectInXMLRoot(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, String encoding, String version, boolean forceWrap, boolean isNamespaceAware, XMLUnmarshaller unmarshaller) { if (forceWrap || shouldWrapObject(object, elementNamespaceUri, elementLocalName, elementPrefix, isNamespaceAware)) { // if the DOMRecord element != descriptor's default // root element, create an XMLRoot, populate and return it Root xmlRoot = new XMLRoot(); xmlRoot.setLocalName(elementLocalName); xmlRoot.setNamespaceURI(elementNamespaceUri); xmlRoot.setObject(object); xmlRoot.setEncoding(encoding); xmlRoot.setVersion(version); setDeclaredTypeOnXMLRoot(xmlRoot, elementNamespaceUri, elementLocalName, isNamespaceAware, unmarshaller); return xmlRoot; } return object; }
xmlRoot.setEncoding(xmlEncoding); xmlRoot.setVersion(xmlVersion); return xmlRoot;
xmlRoot.setEncoding(xmlEncoding); xmlRoot.setVersion(xmlVersion); return xmlRoot;
/** * INTERNAL: * Determines the appropriate object to return from the unmarshal * call. The method will either return the object created in the * xmlReader.parse() call or an instance of Root. An Root * instance will be returned if the DOMRecord element being * unmarshalled does not equal the descriptor's default root * element. * * @param unmarshalRecord * @return object */ public Object wrapObjectInXMLRoot(UnmarshalRecord unmarshalRecord, boolean forceWrap) { String elementLocalName = unmarshalRecord.getLocalName(); String elementNamespaceUri = unmarshalRecord.getRootElementNamespaceUri(); if (forceWrap || shouldWrapObject(unmarshalRecord.getCurrentObject(), elementNamespaceUri, elementLocalName, null, unmarshalRecord.isNamespaceAware())) { Root xmlRoot = new XMLRoot(); xmlRoot.setLocalName(elementLocalName); xmlRoot.setNamespaceURI(elementNamespaceUri); xmlRoot.setObject(unmarshalRecord.getCurrentObject()); xmlRoot.setEncoding(unmarshalRecord.getEncoding()); xmlRoot.setVersion(unmarshalRecord.getVersion()); xmlRoot.setSchemaLocation(unmarshalRecord.getSchemaLocation()); xmlRoot.setNoNamespaceSchemaLocation(unmarshalRecord.getNoNamespaceSchemaLocation()); xmlRoot.setNil(unmarshalRecord.isNil()); setDeclaredTypeOnXMLRoot(xmlRoot, elementNamespaceUri, elementLocalName, unmarshalRecord.isNamespaceAware(), unmarshalRecord.getUnmarshaller()); return xmlRoot; } return unmarshalRecord.getCurrentObject(); }
xmlRoot.setNamespaceURI(elementNamespaceUri); xmlRoot.setObject(unmarshalRecord.getCurrentObject()); xmlRoot.setEncoding(unmarshalRecord.getEncoding()); xmlRoot.setVersion(unmarshalRecord.getVersion()); xmlRoot.setSchemaLocation(unmarshalRecord.getSchemaLocation());