/** * Set if this XMLMarshaller should format the XML * By default this is set to true and the XML marshalled will be formatted. * @param shouldFormat if this XMLMarshaller should format the XML */ public void setFormattedOutput(boolean shouldFormat) { transformer.setFormattedOutput(shouldFormat); }
/** * Set if this XMLMarshaller should format the XML * By default this is set to true and the XML marshalled will be formatted. * @param shouldFormat if this XMLMarshaller should format the XML */ @Override public void setFormattedOutput(boolean shouldFormat) { super.setFormattedOutput(shouldFormat); if(null != transformer) { transformer.setFormattedOutput(shouldFormat); } }
/** * Set if this XMLMarshaller should format the XML * By default this is set to true and the XML marshalled will be formatted. * @param shouldFormat if this XMLMarshaller should format the XML */ @Override public void setFormattedOutput(boolean shouldFormat) { super.setFormattedOutput(shouldFormat); if(null != transformer) { transformer.setFormattedOutput(shouldFormat); } }
public XMLTypeBindCallCustomParameter(Object obj) { super(obj); xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer(); xmlTransformer.setFormattedOutput(false); }
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 DirectToXMLTypeMapping() { super(); this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer(); this.xmlTransformer.setFormattedOutput(false); this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(); this.xmlComparer = new XMLComparer(); }
public DirectToXMLTypeMapping() { super(); this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer(); this.xmlTransformer.setFormattedOutput(false); this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(); this.xmlComparer = new XMLComparer(); }
public DirectToXMLTypeMapping() { super(); this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer(); this.xmlTransformer.setFormattedOutput(false); this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(); this.xmlComparer = new XMLComparer(); }
/** * INTERNAL * @return the transformer instance for this marshaller */ @Override public XMLTransformer getTransformer() { if(null == transformer) { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); transformer = xmlPlatform.newXMLTransformer(); transformer.setEncoding(getEncoding()); transformer.setFormattedOutput(isFormattedOutput()); transformer.setFragment(fragment); } return transformer; }
/** * INTERNAL * @return the transformer instance for this marshaller */ @Override public XMLTransformer getTransformer() { if(null == transformer) { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); transformer = xmlPlatform.newXMLTransformer(); transformer.setEncoding(getEncoding()); transformer.setFormattedOutput(isFormattedOutput()); transformer.setFragment(fragment); } return transformer; }