@Converter public static JavaSource toJavaSource(Object payload) { return new JavaSource(payload); }
public Source createSource(final Object from) { Source source; if (from instanceof String) { source = new StreamSource(new StringReader((String) from)); } else if (from instanceof InputStream) { source = new StreamSource((InputStream) from); } else if (from instanceof Reader) { source = new StreamSource((Reader) from); } else if (from instanceof Node) { source = new DOMSource((Node) from); } else if (from instanceof Source) { source = (Source) from; } else if (from instanceof byte[]) { source = new StreamSource(new ByteArrayInputStream((byte[]) from)); } else { source = new JavaSource(from); } return source; }
public Source createSource(final Object from) { Source source; if (from instanceof String) { source = new StreamSource(new StringReader((String) from)); } else if (from instanceof InputStream) { source = new StreamSource((InputStream) from); } else if (from instanceof Reader) { source = new StreamSource((Reader) from); } else if (from instanceof Node) { source = new DOMSource((Node) from); } else if (from instanceof Source) { source = (Source) from; } else if (from instanceof byte[]) { source = new StreamSource(new ByteArrayInputStream((byte[]) from)); } else { source = new JavaSource(from); } return source; }
public Source createSource(final Object from) { Source source; if (from instanceof String) { source = new StreamSource(new StringReader((String) from)); } else if (from instanceof InputStream) { source = new StreamSource((InputStream) from); } else if (from instanceof Reader) { source = new StreamSource((Reader) from); } else if (from instanceof Node) { source = new DOMSource((Node) from); } else if (from instanceof Source) { source = (Source) from; } else if (from instanceof byte[]) { source = new StreamSource(new ByteArrayInputStream((byte[]) from)); } else { source = new JavaSource(from); } return source; }
public Source createSource(final Object from) { Source source; if (from instanceof String) { source = new StreamSource(new StringReader((String) from)); } else if (from instanceof InputStream) { source = new StreamSource((InputStream) from); } else if (from instanceof Reader) { source = new StreamSource((Reader) from); } else if (from instanceof Node) { source = new DOMSource((Node) from); } else if (from instanceof Source) { source = (Source) from; } else if (from instanceof byte[]) { source = new StreamSource(new ByteArrayInputStream((byte[]) from)); } else { source = new JavaSource(from); } return source; }
@Converter public static JavaSource toJavaSource(JavaResult result) { return new JavaSource(result.getResultMap().values()); }