public static <T>String marshal(Class<T> type, Object object) throws JAXBException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshal(type, object, baos); return new String(baos.toByteArray()); }
@Override public InputStream openStream() { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); JaxbJavaee.marshal(descriptor.getClass(), descriptor, out); return new ByteArrayInputStream(out.toByteArray()); } catch (final JAXBException e) { throw new IllegalArgumentException("Unable to marshal descriptor", e); } } }
public static <T> String marshal(final Class<T> type, final Object object) throws JAXBException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshal(type, object, baos); return new String(baos.toByteArray()); }
public static <T> String marshal(final Class<T> type, final Object object) throws JAXBException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshal(type, object, baos); return new String(baos.toByteArray()); }
@Override public InputStream openStream() { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); JaxbJavaee.marshal(descriptor.getClass(), descriptor, out); return new ByteArrayInputStream(out.toByteArray()); } catch (final JAXBException e) { throw new IllegalArgumentException("Unable to marshal descriptor", e); } } }
protected String getSpecDDAsString(WebModule module) throws JAXBException { return JaxbJavaee.marshal(WebApp.class, module.getSpecDD()); }
private void writeEjbJar(EjbModule ejbModule) { try { EjbJar ejbJar = ejbModule.getEjbJar(); File tempFile = File.createTempFile("ejb-jar-", ejbModule.getModuleId() + ".xml"); FileOutputStream fout = new FileOutputStream(tempFile); BufferedOutputStream out = new BufferedOutputStream(fout); try { JaxbJavaee.marshal(EjbJar.class, ejbJar, out); logger.info("Dumping Generated ejb-jar.xml to: " + tempFile.getAbsolutePath()); } catch (JAXBException e) { } finally { out.close(); } } catch (Exception e) { } } }