- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.google.gdata.util.common.xml.XmlWriter.characters()
方法的一些代码示例,展示了XmlWriter.characters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlWriter.characters()
方法的具体详情如下:
包路径:com.google.gdata.util.common.xml.XmlWriter
类名称:XmlWriter
方法名:characters
[英]Emits character data subject to XML escaping.
[中]发出受XML转义约束的字符数据。
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Emits character data subject to XML escaping.
*
* @param s string to emit. Can be {@code null}.
* @throws IOException thrown by the underlying writer.
*/
public void characters(String s) throws IOException {
characters(s, false);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Emits character data subject to XML escaping.
*
* @param s string to emit. Can be {@code null}.
* @throws IOException thrown by the underlying writer.
*/
public void characters(String s) throws IOException {
characters(s, false);
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuilder();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuffer();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuffer();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuilder();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuffer();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/** SAX callback. */
@Override
public void characters(char[] text, int start, int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer = new StringBuilder();
}
curHandler.buffer.append(text, start, len);
}
if (curHandler.innerXml != null &&
(curHandler.mixedContent || unrecognizedElements > 0)) {
if (curHandler.fullTextIndex) {
curHandler.fullTextIndexWriter.write(text, start, len);
curHandler.fullTextIndexWriter.write("\n");
}
try {
curHandler.innerXml.characters(new String(text, start, len));
} catch (IOException e) {
throw new SAXException(e);
}
}
}
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
public void textContent(XmlWriter xw, Element e,
ElementMetadata<?, ?> metadata) throws IOException {
Object value = (metadata == null) ? e.getTextValue()
: metadata.generateValue(e, metadata);
if (value != null) {
String valStr = value.toString();
if (valStr.length() > 0) {
xw.characters(valStr);
}
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
public void textContent(XmlWriter xw, Element e,
ElementMetadata<?, ?> metadata) throws IOException {
Object value = (metadata == null) ? e.getTextValue()
: metadata.generateValue(e, metadata);
if (value != null) {
String valStr = value.toString();
if (valStr.length() > 0) {
xw.characters(valStr);
}
}
}
代码示例来源:origin: com.google.gdata/gdata-java-client
public void textContent(XmlWriter xw, Element e,
ElementMetadata<?, ?> metadata) throws IOException {
Object value = (metadata == null) ? e.getTextValue()
: metadata.generateValue(e, metadata);
if (value != null) {
String valStr = value.toString();
if (valStr.length() > 0) {
xw.characters(valStr);
}
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Generates XML code for the value of the {@code attribute}.
*
* @param attribute
* @param xmlWriter
* @throws java.io.IOException
*/
private void generateValue(GoogleBaseAttribute attribute, XmlWriter xmlWriter)
throws IOException {
if (attribute.hasValue()) {
xmlWriter.characters(attribute.getValueAsString());
}
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Generates XML code for the value of the {@code attribute}.
*
* @param attribute
* @param xmlWriter
* @throws java.io.IOException
*/
private void generateValue(GoogleBaseAttribute attribute, XmlWriter xmlWriter)
throws IOException {
if (attribute.hasValue()) {
xmlWriter.characters(attribute.getValueAsString());
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Emits a simple element (without child elements).
*
* @param namespace element namespace.
* @param name element name.
* @param attrs attributes. Can be {@code null}.
* @param value element value. Can be {@code null}.
* @throws IOException thrown by the underlying writer.
*/
public void simpleElement(XmlNamespace namespace, String name,
List<Attribute> attrs, String value) throws IOException {
startElement(namespace, name, attrs, null);
characters(value);
endElement(namespace, name);
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Emits a simple element (without child elements).
*
* @param namespace element namespace.
* @param name element name.
* @param attrs attributes. Can be {@code null}.
* @param value element value. Can be {@code null}.
* @throws IOException thrown by the underlying writer.
*/
public void simpleElement(XmlNamespace namespace, String name,
List<Attribute> attrs, String value) throws IOException {
startElement(namespace, name, attrs, null);
characters(value);
endElement(namespace, name);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Emits a simple element (without child elements).
*
* @param namespace element namespace.
* @param name element name.
* @param attrs attributes. Can be {@code null}.
* @param value element value. Can be {@code null}.
* @throws IOException thrown by the underlying writer.
*/
public void simpleElement(XmlNamespace namespace, String name,
List<Attribute> attrs, String value) throws IOException {
startElement(namespace, name, attrs, null);
characters(value);
endElement(namespace, name);
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Writes a attribute to the {@code xmlWriter} with the specified
* {@code namespace} and {@code name} and with the text content defined by
* the {@code value}.
*
* @param xmlWriter
* @param namespace
* @param name
* @param value
* @throws IOException
*/
private void writeXmlNameValue(XmlWriter xmlWriter, Namespace namespace,
String name, String value) throws IOException {
xmlWriter.startElement(namespace,
convertToElementName(name),
null,
null);
xmlWriter.characters(value);
xmlWriter.endElement();
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Writes a attribute to the {@code xmlWriter} with the specified
* {@code namespace} and {@code name} and with the text content defined by
* the {@code value}.
*
* @param xmlWriter
* @param namespace
* @param name
* @param value
* @throws IOException
*/
private void writeXmlNameValue(XmlWriter xmlWriter, Namespace namespace,
String name, String value) throws IOException {
xmlWriter.startElement(namespace,
convertToElementName(name),
null,
null);
xmlWriter.characters(value);
xmlWriter.endElement();
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Generate an Atom XML representation of the current object.
*/
@Override
public void generate(XmlWriter w, ExtensionProfile extProfile)
throws IOException {
List<XmlWriter.Attribute> attributes =
new ArrayList<XmlWriter.Attribute>(4);
if (code > 0) {
attributes.add(new XmlWriter.Attribute("code", Integer.toString(code)));
}
if (reason != null) {
attributes.add(new XmlWriter.Attribute("reason", reason));
}
if (contentType != null) {
// Charset makes no sense in this context
contentType.getAttributes().remove(ContentType.ATTR_CHARSET);
attributes.add(new XmlWriter.Attribute("content-type",
contentType.toString()));
}
generateStartElement(w, Namespaces.batchNs, "status", attributes, null);
generateExtensions(w, extProfile);
if (content != null) {
w.characters(content);
}
w.endElement(Namespaces.batchNs, "status");
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Generate an Atom XML representation of the current object.
*/
@Override
public void generate(XmlWriter w, ExtensionProfile extProfile)
throws IOException {
List<XmlWriter.Attribute> attributes =
new ArrayList<XmlWriter.Attribute>(4);
if (code > 0) {
attributes.add(new XmlWriter.Attribute("code", Integer.toString(code)));
}
if (reason != null) {
attributes.add(new XmlWriter.Attribute("reason", reason));
}
if (contentType != null) {
// Charset makes no sense in this context
contentType.getAttributes().remove(ContentType.ATTR_CHARSET);
attributes.add(new XmlWriter.Attribute("content-type",
contentType.toString()));
}
generateStartElement(w, Namespaces.batchNs, "status", attributes, null);
generateExtensions(w, extProfile);
if (content != null) {
w.characters(content);
}
w.endElement(Namespaces.batchNs, "status");
}
int i; System.out.print("Please enter a string: "); String string_1 = input.nextLine(); System.out
我想要一个正则表达式来检查 a password must be eight characters including one uppercase letter, one special charac
在此先感谢您的帮助。 在命令行输入“example”时,Python 返回“example”。我在网上找不到任何东西来解释这一点。所有引用资料都在 print 命令的上下文中谈到字符串,我得到了所有关
我有 CSV 格式的数据,这些数据在字符编码方面被严重打乱,可能在不同的软件应用程序(LibreOffice Calc、Microsoft、Excel、Google Refine、自定义 PHP/My
我正在为 Latex 使用 Sublime Text,所以我需要使用特定的编码。但是,在某些情况下,当我粘贴从不同程序(大多数情况下为单词/浏览器)复制的文本时,我收到以下消息: "Not all c
在 flutter 中,我使用了一个php文件,该文件从数据库查询返回json响应,但是当我尝试解码json时,出现此错误: E/flutter ( 8294): [ERROR:flutter/lib
我在 Flutter 项目中遇到异常。错误如下所示: Exception has occurred. FormatException (FormatException: Unexpected char
这个问题已经有答案了: Why doesn't my compare work between char and int in Java? (4 个回答) 已关闭 3 年前。 我试图在我的代码中找出
我在 Flutter 项目中遇到异常。错误如下所示: Exception has occurred. FormatException (FormatException: Unexpected char
我是 python 新手,需要一些帮助。我应该编写一个脚本,从键盘读取单词,直到输入单词 999。对于除 999 之外的每个单词,报告该单词是否有效。如果单词的第一个字符等于最后一个字符,则该单词有效
我正在实现自己的词法分析器,并且刚刚了解了 C# 如何处理字 rune 字:https://msdn.microsoft.com/en-us/library/aa691087(v=vs.71).asp
我有这个字符串: var test = "toto@test.com"; 我想用空值替换“@”字符后的所有字符。我想得到这个字符串: var test = "toto" 最佳答案 试试这个: test
我将数据库从 sqlite 更改为 postgresql 以用于我网站的生产,但出现此错误。当我在本地使用 sqlite 时,它没有出现这个错误。使用 Django。 ProgrammingErr
我正在为我的实验表制作凯撒密码,并使其能够加密 3 代入(凯撒密码),这是练习的重点。但是有一件事困扰着我。首先,如果我输入 3 以外的字符,则有一个尾随字符。例如,输入“恶意软件”,然后输入 2 作
遵循 this question 中的逻辑,以下代码应该有效: #include int main(){ printf("%c", '\0101'); return 0; } 然而,
我在处理一段代码时遇到错误: Too many characters in character literal error 使用 C# 和 switch 语句遍历字符串缓冲区并读取标记,但在这一行中出
给定一个元素,其值为: Distrib = SU & Prem <> 0 我要转<或 >进入 <或 >因为下游应用程序需要
从表面上看,他们似乎都在做同样的事情。但似乎是后者as(,"character")更强大。 作为示例,请考虑以下内容: library(rvest) temp % html_node("div p")
我刚开始使用python,所以很可能只是在做一些愚蠢的事情。我正在从表中读取数据,需要将它们放入txt文件的列中。我无法说服我的代码创建新行。 这是我的代码- file = open("test_m.
在尝试刷新我的项目的 Fortran 90 知识时,我在使用内部文件时遇到了一些奇怪的情况。考虑示例代码: ! ---- internal_file_confusion.f90 ---- progra
我是一名优秀的程序员,十分优秀!