public class ElemCup extends Object
对象序列化和反序列化工具
反序列化 向杯子中注入水
序列化把杯子中的水倒出
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ENABLE_DEBUG_PRINT
是否允许调试模式输出XML内容
|
| Constructor and Description |
|---|
ElemCup() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
dump(org.dom4j.Element e)
序列化DOM元素为字节序列
|
static void |
dump(org.dom4j.Element e,
Path to)
序列化文档对象
|
static void |
dumpUpNS(org.dom4j.Element e,
Path to)
序列化元素并升级命名空间
|
static org.dom4j.Element |
inject(Path file)
从文件加载反序列化元素对象
|
public static boolean ENABLE_DEBUG_PRINT
true - 开启,XML含有空格和换行 false - 关闭。XML采用紧凑模式输出,(默认)
public static org.dom4j.Element inject(Path file) throws org.dom4j.DocumentException
file - 文件路径对象org.dom4j.DocumentException - 文件解析异常public static void dump(org.dom4j.Element e,
Path to)
throws IOException
e - 文档对象to - 目标目录IOException - IO异常public static void dumpUpNS(org.dom4j.Element e,
Path to)
throws IOException
命名空间为 Const.OFD_NAMESPACE
e - 元素to - 存储位置IOException - IO异常public static byte[] dump(org.dom4j.Element e)
throws IOException
e - 元素IOException - IO异常Copyright © 2026. All rights reserved.