gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-21 12:37:05 26 4
gpt4 key购买 nike

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

XmlWriter.write介绍

[英]Write a raw character.
[中]写一个原始字符。

代码示例

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

/**
 * Write a processing instruction. Pass the event on down the filter chain
 * for further processing.
 * 
 * @param target
 *            The PI target.
 * @param data
 *            The PI data.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the PI, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#processingInstruction
 */
@Override
public void processingInstruction(String target, String data)
    throws SAXException {
  write("<?");
  write(target);
  write(' ');
  write(data);
  write("?>");
  if (this.elementLevel < 1) {
    write('\n');
  }
  super.processingInstruction(target, data);
}

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

/**
 * Write out an attribute list, escaping values. The names will have
 * prefixes added to them.
 * 
 * @param atts
 *            The attribute list to write.
 * @exception org.xml.SAXException
 *                If there is an error writing the attribute list, this
 *                method will throw an IOException wrapped in a
 *                SAXException.
 */
private void writeAttributes(Attributes atts) throws SAXException {
  final int len = atts.getLength();
  for (int i = 0; i < len; i++) {
    final char ch[] = atts.getValue(i).toCharArray();
    write(' ');
    writeName(atts.getURI(i), atts.getLocalName(i), atts.getQName(i),
        false);
    write("=\"");
    writeEsc(ch, 0, ch.length, true);
    write('"');
  }
}

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

write(' ');
if ("".equals(prefix)) {
  write("xmlns=\"");
} else {
  write("xmlns:");
  write(prefix);
  write("=\"");
write('\"');

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

write("</");
writeName(uri, localName, qName, true);
write('>');
if (this.elementLevel == 1) {
  write('\n');

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

} else {
  final char ch[] = atts.getValue(i).toCharArray();
  write(' ');
  writeName(atts.getURI(i), atts.getLocalName(i),
      atts.getQName(i), false);
  write("=\"");
  writeEsc(ch, 0, ch.length, true);
  write('"');

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

/**
 * Write a processing instruction. Pass the event on down the filter chain
 * for further processing.
 * 
 * @param target
 *            The PI target.
 * @param data
 *            The PI data.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the PI, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#processingInstruction
 */
@Override
public void processingInstruction(String target, String data)
    throws SAXException {
  write("<?");
  write(target);
  write(' ');
  write(data);
  write("?>");
  if (this.elementLevel < 1) {
    write('\n');
  }
  super.processingInstruction(target, data);
}

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

write(' ');
if ("".equals(prefix)) {
  write("xmlns=\"");
} else {
  write("xmlns:");
  write(prefix);
  write("=\"");
write('\"');

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

write("</");
writeName(uri, localName, qName, true);
write('>');
if (this.elementLevel == 1) {
  write('\n');

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

} else {
  final char ch[] = atts.getValue(i).toCharArray();
  write(' ');
  writeName(atts.getURI(i), atts.getLocalName(i),
      atts.getQName(i), false);
  write("=\"");
  writeEsc(ch, 0, ch.length, true);
  write('"');

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

/**
 * Write a processing instruction. Pass the event on down the filter chain
 * for further processing.
 * 
 * @param target
 *            The PI target.
 * @param data
 *            The PI data.
 * @exception org.xml.sax.SAXException
 *                If there is an error writing the PI, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#processingInstruction
 */
@Override
public void processingInstruction(String target, String data)
    throws SAXException {
  write("<?");
  write(target);
  write(' ');
  write(data);
  write("?>");
  if (this.elementLevel < 1) {
    write('\n');
  }
  super.processingInstruction(target, data);
}

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

write(' ');
if ("".equals(prefix)) {
  write("xmlns=\"");
} else {
  write("xmlns:");
  write(prefix);
  write("=\"");
write('\"');

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

/**
 * Write an element or attribute name.
 * 
 * @param uri
 *            The Namespace URI.
 * @param localName
 *            The local name.
 * @param qName
 *            The prefixed name, if available, or the empty string.
 * @param isElement
 *            true if this is an element name, false if it is an attribute
 *            name.
 * @exception org.xml.sax.SAXException
 *                This method will throw an IOException wrapped in a
 *                SAXException if there is an error writing the name.
 */
private void writeName(String uri, String localName, String qName,
    boolean isElement) throws SAXException {
  final String prefix = doPrefix(uri, qName, isElement);
  if ((prefix != null) && !"".equals(prefix)) {
    write(prefix);
    write(':');
  }
  write(localName);
}

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

/**
 * Write an element or attribute name.
 * 
 * @param uri
 *            The Namespace URI.
 * @param localName
 *            The local name.
 * @param qName
 *            The prefixed name, if available, or the empty string.
 * @param isElement
 *            true if this is an element name, false if it is an attribute
 *            name.
 * @exception org.xml.sax.SAXException
 *                This method will throw an IOException wrapped in a
 *                SAXException if there is an error writing the name.
 */
private void writeName(String uri, String localName, String qName,
    boolean isElement) throws SAXException {
  final String prefix = doPrefix(uri, qName, isElement);
  if ((prefix != null) && !"".equals(prefix)) {
    write(prefix);
    write(':');
  }
  write(localName);
}

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

/**
 * Write an element or attribute name.
 * 
 * @param uri
 *            The Namespace URI.
 * @param localName
 *            The local name.
 * @param qName
 *            The prefixed name, if available, or the empty string.
 * @param isElement
 *            true if this is an element name, false if it is an attribute
 *            name.
 * @exception org.xml.sax.SAXException
 *                This method will throw an IOException wrapped in a
 *                SAXException if there is an error writing the name.
 */
private void writeName(String uri, String localName, String qName,
    boolean isElement) throws SAXException {
  final String prefix = doPrefix(uri, qName, isElement);
  if ((prefix != null) && !"".equals(prefix)) {
    write(prefix);
    write(':');
  }
  write(localName);
}

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

/**
 * Write a newline at the end 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 newline, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#endDocument
 */
@Override
public void endDocument() throws SAXException {
  write('\n');
  super.endDocument();
  try {
    flush();
  } catch (IOException e) {
    throw new SAXException(e);
  }
}

代码示例来源: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();
}

代码示例来源: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 a newline at the end 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 newline, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#endDocument
 */
@Override
public void endDocument() throws SAXException {
  write('\n');
  super.endDocument();
  try {
    flush();
  } catch (IOException e) {
    throw new SAXException(e);
  }
}

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

/**
 * Write a newline at the end 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 newline, or if a restlet
 *                further down the filter chain raises an exception.
 * @see org.xml.sax.ContentHandler#endDocument
 */
@Override
public void endDocument() throws SAXException {
  write('\n');
  super.endDocument();
  try {
    flush();
  } catch (IOException e) {
    throw new SAXException(e);
  }
}

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