gpt4 book ai didi

org.restlet.ext.xml.XmlWriter.reset()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 13:45:05 27 4
gpt4 key购买 nike

本文整理了Java中org.restlet.ext.xml.XmlWriter.reset()方法的一些代码示例,展示了XmlWriter.reset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlWriter.reset()方法的具体详情如下:
包路径:org.restlet.ext.xml.XmlWriter
类名称:XmlWriter
方法名:reset

XmlWriter.reset介绍

[英]Reset the writer.

This method is especially useful if the writer throws an exception before it is finished, and you want to reuse the writer for a new document. It is usually a good idea to invoke #flush before resetting the writer, to make sure that no output is lost.

This method is invoked automatically by the #startDocument method before writing a new document.

Note: this method will not clear the prefix or URI information in the writer or the selected output writer.
[中]重置写入程序。
如果编写器在完成之前抛出异常,并且您希望将编写器重新用于新文档,则此方法尤其有用。在重置写入程序之前调用#flush通常是一个好主意,以确保没有输出丢失。
在编写新文档之前,#startDocument方法会自动调用此方法。
注意:此方法将清除写入程序或所选输出写入程序中的前缀或URI信息。

代码示例

代码示例来源:origin: org.restlet/org.restlet.ext.xml

/**
 * Write the XML declaration at the beginning of the document. Pass the
 * event on down the filter chain for further processing.
 * 
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the XML declaration, or if a
 *                restlet further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#startDocument
 */
@Override
public void startDocument() throws SAXException {
  reset();
  write("<?xml version=\"1.0\" standalone='yes'?>\n\n");
  super.startDocument();
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.xml

/**
 * Write the XML declaration at the beginning of the document. Pass the
 * event on down the filter chain for further processing.
 * 
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the XML declaration, or if a
 *                restlet further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#startDocument
 */
@Override
public void startDocument() throws SAXException {
  reset();
  write("<?xml version=\"1.0\" standalone='yes'?>\n");
  super.startDocument();
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.xml

/**
 * Write the XML declaration at the beginning of the document. Pass the
 * event on down the filter chain for further processing.
 * 
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the XML declaration, or if a
 *                restlet further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#startDocument
 */
@Override
public void startDocument() throws SAXException {
  reset();
  write("<?xml version=\"1.0\" standalone='yes'?>\n");
  super.startDocument();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com