當前位置: 首頁>>代碼示例>>Java>>正文


Java UtilXml.writeXmlDocument方法代碼示例

本文整理匯總了Java中org.ofbiz.base.util.UtilXml.writeXmlDocument方法的典型用法代碼示例。如果您正苦於以下問題:Java UtilXml.writeXmlDocument方法的具體用法?Java UtilXml.writeXmlDocument怎麽用?Java UtilXml.writeXmlDocument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.ofbiz.base.util.UtilXml的用法示例。


在下文中一共展示了UtilXml.writeXmlDocument方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeXmlDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static boolean writeXmlDocument(String str, Node node, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) {
    try {
        File file = FileUtil.getFile(str);
        if (file != null) {
            FileOutputStream os = new FileOutputStream(file);
            UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount);
            os.close();
            return true;
        } else {
            Debug.logError("Unable to create XML document " + str, module);
        }
    } catch (Exception e) {
        Debug.logError(e, "Error while writing XML document " + str, module);
    }
    return false;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:17,代碼來源:UelFunctions.java

示例2: toString

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
@Override
public String toString() {
    try {
        return UtilXml.writeXmlDocument(document);
    } catch (IOException e) {
        Debug.logError(e, module);
        throw new IllegalStateException("Unable to write document as String");
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:10,代碼來源:PcChargeApi.java

示例3: serialize

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static String serialize(Object object) throws SerializeException, FileNotFoundException, IOException {
    Document document = UtilXml.makeEmptyXmlDocument("ofbiz-ser");
    Element rootElement = document.getDocumentElement();

    rootElement.appendChild(serializeSingle(object, document));
    return UtilXml.writeXmlDocument(document);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:8,代碼來源:XmlSerializer.java

示例4: toXmlString

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static String toXmlString(Node node, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) {
    try {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        UtilXml.writeXmlDocument(node, os, encoding, omitXmlDeclaration, indent, indentAmount);
        os.close();
        return os.toString();
    } catch (Exception e) {
        Debug.logError(e, "Error while creating XML String ", module);
    }
    return null;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:12,代碼來源:UelFunctions.java

示例5: writeResponse

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public void writeResponse(HttpServletResponse response, Writer writer) throws IOException {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    try {
        UtilXml.writeXmlDocument(os, this.responseDocument, "UTF-8", true, true);
    } catch (Exception e) {
        throw new IOException(e.getMessage());
    }
    response.setContentLength(os.size());
    writer.write(os.toString("UTF-8"));
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:11,代碼來源:ResponseHelper.java

示例6: getViewXml

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public String getViewXml(String entityName) throws IOException {
    Document doc = UtilXml.makeEmptyXmlDocument();
    Element viewElement = getViewElement(doc, entityName);
    return UtilXml.writeXmlDocument(viewElement);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:6,代碼來源:DynamicViewEntity.java

示例7: serialize

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static String serialize(Object object) throws SerializeException, FileNotFoundException, IOException {
    Document document = UtilXml.makeEmptyXmlDocument("ofbiz-ser");
    Element rootElement = document.getDocumentElement();
    rootElement.appendChild(XmlSerializer.serializeSingle(object, document));
    return UtilXml.writeXmlDocument(document);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:7,代碼來源:SoapSerializer.java


注:本文中的org.ofbiz.base.util.UtilXml.writeXmlDocument方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。