public Object convertObjectValueToDataValue(Object objectValue, Session session, XMLMarshaller marshaller) { if (objectValue != null && elementClass.isAssignableFrom(objectValue.getClass())) { ErrorHandler handler = marshaller.getErrorHandler(); Source source = null; if(handler != null && handler instanceof JAXBErrorHandler) { source = domHandler.marshal(objectValue, ((JAXBErrorHandler)handler).getValidationEventHandler()); } else { source = domHandler.marshal(objectValue, null); } DOMResult result = new DOMResult(); if(source instanceof DOMSource){ Node n = ((DOMSource)source).getNode(); if(n.getNodeType() == Node.DOCUMENT_NODE){ return ((Document)n).getDocumentElement(); } return n; }else{ XMLTransformer xmlTransformer = xmlPlatform.newXMLTransformer(); xmlTransformer.setFormattedOutput(marshaller.isFormattedOutput()); xmlTransformer.transform(source, result); return result.getNode().getFirstChild(); } } return objectValue; }
public Object convertObjectValueToDataValue(Object objectValue, Session session, XMLMarshaller marshaller) { if (objectValue != null && elementClass.isAssignableFrom(objectValue.getClass())) { ErrorHandler handler = marshaller.getErrorHandler(); Source source = null; if(handler != null && handler instanceof JAXBErrorHandler) { source = domHandler.marshal(objectValue, ((JAXBErrorHandler)handler).getValidationEventHandler()); } else { source = domHandler.marshal(objectValue, null); } DOMResult result = new DOMResult(); if(source instanceof DOMSource){ Node n = ((DOMSource)source).getNode(); if(n.getNodeType() == Node.DOCUMENT_NODE){ return ((Document)n).getDocumentElement(); } return n; }else{ XMLTransformer xmlTransformer = xmlPlatform.newXMLTransformer(); xmlTransformer.setFormattedOutput(marshaller.isFormattedOutput()); xmlTransformer.transform(source, result); return result.getNode().getFirstChild(); } } return objectValue; }
public Object getProperty(String propName) throws PropertyException { if (null == propName) { throw new IllegalArgumentException(); } if (propName.equals(Marshaller.JAXB_ENCODING)) { return this.xmlBinder.getMarshaller().getEncoding(); } if (propName.equals(Marshaller.JAXB_FORMATTED_OUTPUT)) { return this.xmlBinder.getMarshaller().isFormattedOutput(); } if (propName.equals(Marshaller.JAXB_FRAGMENT)) { return this.xmlBinder.getMarshaller().isFragment(); } if (propName.equals(Marshaller.JAXB_SCHEMA_LOCATION)) { return this.xmlBinder.getMarshaller().getSchemaLocation(); } if (propName.equals(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION)) { return this.xmlBinder.getMarshaller().getNoNamespaceSchemaLocation(); } throw new PropertyException(propName); }
@Override public Object getProperty(String propName) throws PropertyException { if (null == propName) { throw new IllegalArgumentException(); } if (propName.equals(Marshaller.JAXB_ENCODING)) { return this.xmlBinder.getMarshaller().getEncoding(); } if (propName.equals(Marshaller.JAXB_FORMATTED_OUTPUT)) { return this.xmlBinder.getMarshaller().isFormattedOutput(); } if (propName.equals(Marshaller.JAXB_FRAGMENT)) { return this.xmlBinder.getMarshaller().isFragment(); } if (propName.equals(Marshaller.JAXB_SCHEMA_LOCATION)) { return this.xmlBinder.getMarshaller().getSchemaLocation(); } if (propName.equals(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION)) { return this.xmlBinder.getMarshaller().getNoNamespaceSchemaLocation(); } throw new PropertyException(propName); }
throw new IllegalArgumentException(); } else if (JAXB_FORMATTED_OUTPUT.equals(key)) { return xmlMarshaller.isFormattedOutput(); } else if (JAXB_ENCODING.equals(key)) { return xmlMarshaller.getEncoding();
throw new IllegalArgumentException(); } else if (JAXB_FORMATTED_OUTPUT.equals(key)) { return xmlMarshaller.isFormattedOutput(); } else if (JAXB_ENCODING.equals(key)) { return xmlMarshaller.getEncoding();
if (isFormattedOutput()) { record = new FormattedOutputStreamRecord(); } else {
if(anXMLMarshaller.isFormattedOutput()) { writerRecord = new FormattedWriterRecord(); } else {
if(anXMLMarshaller.isFormattedOutput()) { writerRecord = new FormattedWriterRecord(); } else {
if(anXMLMarshaller.isFormattedOutput()) { writerRecord = new FormattedWriterRecord(); } else {
if(anXMLMarshaller.isFormattedOutput()) { writerRecord = new FormattedWriterRecord(); } else {
if (isFormattedOutput()) { writerRecord = new FormattedWriterRecord(); } else {