/**
* Writes the objet and CLOSES the stream. Uses the persistence delegate registered in this class.
*
* @param os The stream to write to. Will be closed.
* @param o The object to be serialized.
* @param listener The listener to recieve the exeptions if there are any. If <code>null</code> not used.
*/
void writeXMLObject(final OutputStream os, final Object o, final ExceptionListener listener) {
final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(LayoutUtilCommon.class.getClassLoader());
final XMLEncoder encoder = new XMLEncoder(os);
if (listener != null) {
encoder.setExceptionListener(listener);
}
encoder.writeObject(o);
encoder.close(); // Must be closed to write.
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
LayoutUtilCommon.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:jo-widgets
作者:
评论列表
文章目录