Browse Source

update:更新xmlkit

master
zjz1993 5 years ago
parent
commit
49a9c4f5d4
  1. 39
      src/main/java/com/fanruan/api/xml/XmlKit.java

39
src/main/java/com/fanruan/api/xml/XmlKit.java

@ -1,38 +1,49 @@
package com.fanruan.api.xml; package com.fanruan.api.xml;
import com.fr.stable.xml.*;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
import java.io.InputStream; import java.io.InputStream;
/**
* xml读写相关类
*/
public class XmlKit { public class XmlKit {
/** /**
* 从输入流中读取对象 * 从输入流中读取对象
* @param xmlReadable xml读取对象
* @param inputStream xml输入流
* *
* @param read xml读取对象
* @param in xml输入流
*/ */
public static void readInputStreamXML(XMLReadable xmlReadable, InputStream inputStream) throws Exception { public static void readInputStreamXML(XMLReadable read, InputStream in) throws Exception {
XMLTools.readInputStreamXML(xmlReadable, inputStream); XMLTools.readInputStreamXML(read, in);
} }
/** /**
* 从输入源中读取xml * 将xml读取为具体的java对象
* @param reader 输入源
* @return xml文件
* *
* @param reader xml读取器
* @return java对象
*/ */
public static XMLable readXMLable(XMLableReader reader) { public static XMLable readXMLable(XMLableReader reader) {
return GeneralXMLTools.readXMLable(reader); return GeneralXMLTools.readXMLable(reader);
} }
/** /**
* 写XMLable * 将java对象写为xml文件
* @param writer 输出源
* @param xml xml文件
* @param tagName 标签名
* @return 节点名
* *
* @param writer xml写入器
* @param xml 实际java对象
* @param tagName xml标签名
*/ */
public static void writeXMLable(XMLPrintWriter writer, XMLable xml, String tagName) { public static void writeXMLable(XMLPrintWriter writer, XMLable xml, String tagName) {
GeneralXMLTools.writeXMLable(writer, xml, tagName); GeneralXMLTools.writeXMLable(writer, xml, tagName);
} }
}
}
Loading…
Cancel
Save