public Source transform(Node source, TransformationContext context) { try { return new DOMSource(source); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(InputStream source, ContentHandler target, TransformationContext context) { try { XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setContentHandler(target); reader.parse(new InputSource(source)); } catch (Exception e) { throw new TransformationException(e); } }
public String transform(Source source, TransformationContext context) { try { javax.xml.transform.Transformer transformer = factory.newTransformer(); StringWriter sw = new StringWriter(); StreamResult result = new StreamResult(sw); transformer.transform(source, result); return sw.toString(); } catch (Exception e) { throw new TransformationException(e); } }
public String transform(Source source, TransformationContext context) { try { javax.xml.transform.Transformer transformer = factory.newTransformer(); StringWriter sw = new StringWriter(); StreamResult result = new StreamResult(sw); transformer.transform(source, result); return sw.toString(); } catch (Exception e) { throw new TransformationException(e); } }
public String transform(XMLStreamReader source, TransformationContext context) { try { String str = helper.saveAsString(source); source.close(); return str; } catch (XMLStreamException e) { throw new TransformationException(e); } }
public Node transform(InputStream source, TransformationContext context) { try { Source streamSource = new SAXSource(new InputSource(source)); DOMResult result = new DOMResult(); TRANSFORMER.transform(streamSource, result, context); return result.getNode(); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(Node source, OutputStream writer, TransformationContext context) { try { Source domSource = new DOMSource(source); Result result = new StreamResult(writer); TRANSFORMER.transform(domSource, result, context); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(Node source, Writer writer, TransformationContext context) { try { Source domSource = new DOMSource(source); Result result = new StreamResult(writer); TRANSFORMER.transform(domSource, result, context); } catch (Exception e) { throw new TransformationException(e); } }
public String transform(Node source, TransformationContext context) { try { StringWriter writer = new StringWriter(); TRANSFORMER.transform(source, writer, context); return writer.toString(); } catch (Exception e) { throw new TransformationException(e); } }
public Node transform(Reader source, TransformationContext context) { try { Source streamSource = new StreamSource(source); DOMResult result = new DOMResult(); TRANSFORMER.transform(streamSource, result, context); return result.getNode(); } catch (Exception e) { throw new TransformationException(e); } }
public XMLStreamReader transform(Node source, TransformationContext context) { if (source == null) { return null; } try { DOMXMLStreamReader reader = new DOMXMLStreamReader(source); return reader; } catch (Exception e) { throw new TransformationException(e); } }
public Node transform(InputSource source, TransformationContext context) { try { Source streamSource = new StreamSource(source.getCharacterStream()); DOMResult result = new DOMResult(); TRANSFORMER.transform(streamSource, result, context); return result.getNode(); } catch (Exception e) { throw new TransformationException(e); } }
public Node transform(InputStream source, TransformationContext context) { try { Source streamSource = new SAXSource(new InputSource(source)); DOMResult result = new DOMResult(); TRANSFORMER.transform(streamSource, result, context); return result.getNode(); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(String source, ContentHandler target, TransformationContext context) { try { new InputSource2SAX().transform(new InputSource(new StringReader(source)), target, context); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(Reader source, ContentHandler target, TransformationContext context) { try { new InputSource2SAX().transform(new InputSource(source), target, context); } catch (Exception e) { throw new TransformationException(e); } }
public void transform(Reader source, ContentHandler target, TransformationContext context) { try { new InputSource2SAX().transform(new InputSource(source), target, context); } catch (Exception e) { throw new TransformationException(e); } }
private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) { WrapperHandler wrapperHandler = null; if (dataBindingId != null) { DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId); wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); } if (wrapperHandler == null && required) { throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId); } return wrapperHandler; }
public OMElement transform(XMLStreamReader source, TransformationContext context) { if (source == null) { return null; } try { StAXOMBuilder builder = new StAXOMBuilder(source); OMElement element = builder.getDocumentElement(); AxiomHelper.adjustElementName(context, element); return element; } catch (Exception e) { throw new TransformationException(e); } }
private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) { WrapperHandler wrapperHandler = null; if (dataBindingId != null) { DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId); wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); } if (wrapperHandler == null && required) { throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId); } return wrapperHandler; }
public Object transform(String source, TransformationContext context) { try { Class<?> type = null; if (context != null && context.getTargetDataType() != null) { type = context.getTargetDataType().getPhysical(); } return JSONHelper.toJSON(source, type); } catch (Exception e) { throw new TransformationException(e); } }