从XML中读取对象
importcn.hutool.core.io.FileUtil; importcn.hutool.core.util.XmlUtil; publicclassTest { publicstaticvoidmain(String[] args) { StringxmlStr="f://text.xml"; Objecto=XmlUtil.readObjectFromXml(FileUtil.file(xmlStr)); } }
从XML中读取对象
importcn.hutool.core.io.FileUtil; importcn.hutool.core.util.XmlUtil; publicclassTest { publicstaticvoidmain(String[] args) { StringxmlStr="f://text.xml"; Objecto=XmlUtil.readObjectFromXml(FileUtil.file(xmlStr)); } }