/** * Convert the passed object to a new DOM document * * @param aObject The object to be converted. May not be <code>null</code>. * @return <code>null</code> if converting the document failed. */ @Nullable public final Document write(@Nonnull final JAXBTYPE aObject) { ValueEnforcer.notNull(aObject, "Object"); final Document aDoc = XMLFactory.newDocument(); return write(aObject, TransformResultFactory.create(aDoc)).isSuccess() ? aDoc : null; }
/** * Write the passed object to an {@link IWritableResource}. * * @param aObject The object to be written. May not be <code>null</code>. * @param aResource The result resource to be written to. May not be <code>null</code>. * @return {@link ESuccess} */ @Nonnull public final ESuccess write( @Nonnull final JAXBTYPE aObject, @Nonnull final IWritableResource aResource) { return write(aObject, TransformResultFactory.create(aResource)); }