- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.google.gdata.util.common.xml.XmlWriter.<init>()
方法的一些代码示例,展示了XmlWriter.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlWriter.<init>()
方法的具体详情如下:
包路径:com.google.gdata.util.common.xml.XmlWriter
类名称:XmlWriter
方法名:<init>
[英]Constructs an XmlWriter instance associated that will generate XML content to an underlying Writer.
[中]构造一个关联的XmlWriter实例,该实例将为底层编写器生成XML内容。
代码示例来源:origin: com.google.gdata/gdata-java-client
public XmlWriter getRequestWriter() throws IOException {
OutputStream requestStream = getRequestStream();
Writer writer = new OutputStreamWriter(requestStream, "utf-8");
return new XmlWriter(writer);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
public XmlWriter getRequestWriter() throws IOException {
OutputStream requestStream = getRequestStream();
Writer writer = new OutputStreamWriter(requestStream, "utf-8");
return new XmlWriter(writer);
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
public XmlWriter getRequestWriter() throws IOException {
OutputStream requestStream = getRequestStream();
Writer writer = new OutputStreamWriter(requestStream, "utf-8");
return new XmlWriter(writer);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* If a derived class wishes to retrieve all unrecognized XML in a blob,
* it calls this method. It must be called in the constructor, in
* the parent element handler, or in {@link #processAttribute}.
*
* @param xmlBlob
* Supplies the XML blob that stores the resulting XML.
*
* @param mixedContent
* Specifies that the handler accepts mixed content XML.
*
* @param fullTextIndex
* Flag indicating whether unrecognized XML should be processed
* for full-text indexing. If set, the resulting string ready for
* indexing is stored in {@link XmlBlob#fullText}.
*/
public void initializeXmlBlob(XmlBlob xmlBlob,
boolean mixedContent,
boolean fullTextIndex) throws IOException {
assert okToInitializeXmlBlob;
this.xmlBlob = xmlBlob;
this.mixedContent = mixedContent;
this.innerXmlStringWriter = new StringWriter();
this.innerXml = new XmlWriter(innerXmlStringWriter);
this.fullTextIndex = fullTextIndex;
if (fullTextIndex) {
this.fullTextIndexWriter = new StringWriter();
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* If a derived class wishes to retrieve all unrecognized XML in a blob,
* it calls this method. It must be called in the constructor, in
* the parent element handler, or in {@link #processAttribute}.
*
* @param xmlBlob
* Supplies the XML blob that stores the resulting XML.
*
* @param mixedContent
* Specifies that the handler accepts mixed content XML.
*
* @param fullTextIndex
* Flag indicating whether unrecognized XML should be processed
* for full-text indexing. If set, the resulting string ready for
* indexing is stored in {@link XmlBlob#fullText}.
*/
public void initializeXmlBlob(XmlBlob xmlBlob,
boolean mixedContent,
boolean fullTextIndex) throws IOException {
assert okToInitializeXmlBlob;
this.xmlBlob = xmlBlob;
this.mixedContent = mixedContent;
this.innerXmlStringWriter = new StringWriter();
this.innerXml = new XmlWriter(innerXmlStringWriter);
this.fullTextIndex = fullTextIndex;
if (fullTextIndex) {
this.fullTextIndexWriter = new StringWriter();
}
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* If a derived class wishes to retrieve all unrecognized XML in a blob,
* it calls this method. It must be called in the constructor, in
* the parent element handler, or in {@link #processAttribute}.
*
* @param xmlBlob
* Supplies the XML blob that stores the resulting XML.
*
* @param mixedContent
* Specifies that the handler accepts mixed content XML.
*
* @param fullTextIndex
* Flag indicating whether unrecognized XML should be processed
* for full-text indexing. If set, the resulting string ready for
* indexing is stored in {@link XmlBlob#fullText}.
*/
public void initializeXmlBlob(XmlBlob xmlBlob,
boolean mixedContent,
boolean fullTextIndex) throws IOException {
assert okToInitializeXmlBlob;
this.xmlBlob = xmlBlob;
this.mixedContent = mixedContent;
this.innerXmlStringWriter = new StringWriter();
this.innerXml = new XmlWriter(innerXmlStringWriter);
this.fullTextIndex = fullTextIndex;
if (fullTextIndex) {
this.fullTextIndexWriter = new StringWriter();
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Returns an XmlWriter configured based upon request attributes.
*
* @param w The underlying writer to write to
* @param outProps output properties
* @param charset The writer's character encoding (determines which characters
* need to be escaped. Note that the writer must already be configured to
* use this character set. If the writer and the character set are out of
* sync, the generated XML may be overly escaped (not too bad) or
* malformed (pretty serious.)
* @return An XmlWriter
* @throws IOException If an error occurs creating the XmlWriter.
*/
protected XmlWriter getXmlWriter(Writer w, OutputProperties outProps,
String charset) throws IOException {
EnumSet<WriterFlags> writerFlags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (usePrettyPrint(outProps)) {
writerFlags.add(WriterFlags.PRETTY_PRINT);
}
return new XmlWriter(w, writerFlags, charset);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Creates a new xml generator for generating xml output, using the
* given namespace as the default namespace.
*/
public XmlGenerator(StreamProperties props, Writer w, Charset cs,
boolean prettyPrint, XmlNamespace defaultNamespace) {
EnumSet<WriterFlags> flags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (prettyPrint) {
flags.add(WriterFlags.PRETTY_PRINT);
}
try {
this.xw = new XmlWriter(w, flags, cs.name());
} catch (IOException ioe) {
throw new RuntimeException("Unable to create XML generator", ioe);
}
this.rootMetadata = props.getRootMetadata();
this.defaultNamespace = defaultNamespace;
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Creates a new xml generator for generating xml output, using the
* given namespace as the default namespace.
*/
public XmlGenerator(StreamProperties props, Writer w, Charset cs,
boolean prettyPrint, XmlNamespace defaultNamespace) {
EnumSet<WriterFlags> flags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (prettyPrint) {
flags.add(WriterFlags.PRETTY_PRINT);
}
try {
this.xw = new XmlWriter(w, flags, cs.name());
} catch (IOException ioe) {
throw new RuntimeException("Unable to create XML generator", ioe);
}
this.rootMetadata = props.getRootMetadata();
this.defaultNamespace = defaultNamespace;
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Creates a new xml generator for generating xml output, using the
* given namespace as the default namespace.
*/
public XmlGenerator(StreamProperties props, Writer w, Charset cs,
boolean prettyPrint, XmlNamespace defaultNamespace) {
EnumSet<WriterFlags> flags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (prettyPrint) {
flags.add(WriterFlags.PRETTY_PRINT);
}
try {
this.xw = new XmlWriter(w, flags, cs.name());
} catch (IOException ioe) {
throw new RuntimeException("Unable to create XML generator", ioe);
}
this.rootMetadata = props.getRootMetadata();
this.defaultNamespace = defaultNamespace;
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Returns an XmlWriter configured based upon request attributes.
*
* @param w The underlying writer to write to
* @param outProps output properties
* @param charset The writer's character encoding (determines which characters
* need to be escaped. Note that the writer must already be configured to
* use this character set. If the writer and the character set are out of
* sync, the generated XML may be overly escaped (not too bad) or
* malformed (pretty serious.)
* @return An XmlWriter
* @throws IOException If an error occurs creating the XmlWriter.
*/
protected XmlWriter getXmlWriter(Writer w, OutputProperties outProps,
String charset) throws IOException {
EnumSet<WriterFlags> writerFlags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (usePrettyPrint(outProps)) {
writerFlags.add(WriterFlags.PRETTY_PRINT);
}
return new XmlWriter(w, writerFlags, charset);
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Returns an XmlWriter configured based upon request attributes.
*
* @param w The underlying writer to write to
* @param outProps output properties
* @param charset The writer's character encoding (determines which characters
* need to be escaped. Note that the writer must already be configured to
* use this character set. If the writer and the character set are out of
* sync, the generated XML may be overly escaped (not too bad) or
* malformed (pretty serious.)
* @return An XmlWriter
* @throws IOException If an error occurs creating the XmlWriter.
*/
protected XmlWriter getXmlWriter(Writer w, OutputProperties outProps,
String charset) throws IOException {
EnumSet<WriterFlags> writerFlags = EnumSet.of(WriterFlags.WRITE_HEADER);
if (usePrettyPrint(outProps)) {
writerFlags.add(WriterFlags.PRETTY_PRINT);
}
return new XmlWriter(w, writerFlags, charset);
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* @return a plain-text representation of this text construct,
* or {@code null} in case of error
*/
@Override
public String getPlainText() {
try {
StringWriter sw = new StringWriter();
XmlWriter xw = new XmlWriter(sw);
xw.innerXml(xhtml.getBlob());
return HtmlToText.htmlToPlainText(sw.toString());
} catch (IOException e) {
// IOException isn't very meaningful to callers, so it's better to
// return null in this case.
return null;
}
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* @return a plain-text representation of this text construct,
* or {@code null} if there is no text content available.
*/
@Override
public String getPlainText() {
if (xhtml == null) {
return null;
}
try {
StringWriter sw = new StringWriter();
XmlWriter xw = new XmlWriter(sw);
xw.innerXml(xhtml.getBlob());
return HtmlToText.htmlToPlainText(sw.toString());
} catch (IOException e) {
// IOException isn't very meaningful to callers, so it's better to
// return null in this case.
return null;
}
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* @return a plain-text representation of this text construct,
* or {@code null} if there is no text content available.
*/
@Override
public String getPlainText() {
if (xhtml == null) {
return null;
}
try {
StringWriter sw = new StringWriter();
XmlWriter xw = new XmlWriter(sw);
xw.innerXml(xhtml.getBlob());
return HtmlToText.htmlToPlainText(sw.toString());
} catch (IOException e) {
// IOException isn't very meaningful to callers, so it's better to
// return null in this case.
return null;
}
}
代码示例来源:origin: wso2-attic/esb-connectors
/**
* Generates a SOAP envelope based on XML Serialization provided by GData(BaseEntry) API generate method.
*
* @param baseEntry the object to be serialized.
* @param contactsService Contacts Service object.
* @return A SOAP Envelope containing the XML generated from the object.
* @throws IOException On failure to initialize XML Writer.
* @throws XMLStreamException On failure to convert XML String to OM Element.
*/
protected final SOAPEnvelope getGDataSOAPEnvelope(final BaseEntry< ? > baseEntry,
final ContactsService contactsService) throws IOException, XMLStreamException {
Writer stringWriter = new StringWriter();
XmlWriter xmlWriter = new XmlWriter(stringWriter);
baseEntry.generate(xmlWriter, contactsService.getExtensionProfile());
return TransportUtils.createSOAPEnvelope(AXIOMUtil.stringToOM(stringWriter.toString()));
}
代码示例来源:origin: wso2-attic/esb-connectors
/**
* Generates a SOAP envelope based on XML Serialization provided by GData(BaseFeed) API generate method.
*
* @param baseFeed The object to be serialized.
* @param contactsService Contact Service object.
* @return a SOAP envelope containing the serialized XML.
* @throws IOException Thrown on failure to initialize the XML writer.
* @throws XMLStreamException On failure to convert the XML String to OMElement.
*/
public final SOAPEnvelope getGDataSOAPEnvelope(final BaseFeed< ? , ? > baseFeed,
final ContactsService contactsService) throws IOException, XMLStreamException {
Writer stringWriter = new StringWriter();
XmlWriter xmlWriter = new XmlWriter(stringWriter);
baseFeed.generate(xmlWriter, contactsService.getExtensionProfile());
return TransportUtils.createSOAPEnvelope(AXIOMUtil.stringToOM(stringWriter.toString()));
}
代码示例来源:origin: com.google.gdata/gdata-java-client
/**
* Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This
* operation overwrites the current contents of this extension point.
*/
public void parseCumulativeXmlBlob(XmlBlob blob,
ExtensionProfile extProfile,
Class<? extends ExtensionPoint> extendedClass)
throws IOException, ParseException {
this.xmlBlob = new XmlBlob();
nonRepeatingExtensionMap.clear();
repeatingExtensionMap.clear();
// Prepare a fake XML document from the blob.
StringWriter sw = new StringWriter();
XmlWriter w = new XmlWriter(sw);
XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null);
XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob);
// Now parse it.
StringReader sr = new StringReader(sw.toString());
XmlParser parser = new XmlParser();
parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "",
"CUMULATIVE_BLOB");
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
/**
* Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This
* operation overwrites the current contents of this extension point.
*/
public void parseCumulativeXmlBlob(XmlBlob blob,
ExtensionProfile extProfile,
Class<? extends ExtensionPoint> extendedClass)
throws IOException, ParseException {
this.xmlBlob = new XmlBlob();
nonRepeatingExtensionMap.clear();
repeatingExtensionMap.clear();
// Prepare a fake XML document from the blob.
StringWriter sw = new StringWriter();
XmlWriter w = new XmlWriter(sw);
XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null);
XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob);
// Now parse it.
StringReader sr = new StringReader(sw.toString());
XmlParser parser = new XmlParser();
parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "",
"CUMULATIVE_BLOB");
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
/**
* Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This
* operation overwrites the current contents of this extension point.
*/
public void parseCumulativeXmlBlob(XmlBlob blob,
ExtensionProfile extProfile,
Class<? extends ExtensionPoint> extendedClass)
throws IOException, ParseException {
this.xmlBlob = new XmlBlob();
nonRepeatingExtensionMap.clear();
repeatingExtensionMap.clear();
// Prepare a fake XML document from the blob.
StringWriter sw = new StringWriter();
XmlWriter w = new XmlWriter(sw);
XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null);
XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob);
// Now parse it.
StringReader sr = new StringReader(sw.toString());
XmlParser parser = new XmlParser();
parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "",
"CUMULATIVE_BLOB");
}
最近,我开始学习 cuis-smalltalk,我没有意识到与 CLOS 相比,Smalltalk 的 OOP 有多么深刻和深入(我使用的是 Ruby)。我了解到 Smalltalk 是一个自己实现的
Maven存储库包含以下两个依赖项:org.apache.commons:commons-io:1.3.2和commons-io:commons-io:1.3.2。有什么区别,我应该在pom.xml中
我刚刚在我的 pom 文件中看到 Apache commons-collections 有两个不同的组 ID: commons-collections commons-collect
Windows 上的 Common Lisp 中是否有用于串行端口通信的库? 最佳答案 下面是一些使用 SBCL 外部函数 POSIX 调用实现串行通信的函数。它不如完整的库好,但我解决了根据此协议(
SBCL 64位,1.1.7 如果我想创建一个包并使用package:CL中的一些符号,我将创建一个像这样的包: (defpackage :foo (:import-from :cl
我正在忙着学习Common Lisp,并且正在寻找一种静态代码分析工具,该工具将帮助我开发更好的样式并避免陷入常见的陷阱。 我找到了Lisp Critic,看起来不错,但我希望有人可以推荐其他一些工具
我正在阅读《Practical Common Lisp》一书,在第 22 章第 284 页的脚注 5 中,我看到一段让我感到困惑的代码片段。 我知道变量list和tail有一个共同的列表结构,但我很困
我正在阅读 Practical Common Lisp ,并且对 Lisp 的 COPY-TREE 函数有疑问。 书中给出了调用的例子 (copy-tree '( '(1 2) '(3 4) '(5
我正在尝试使用 user guide 中的抓取示例运行 geb用于引入依赖项: $ cat my.groovy @Grapes([ @Grab("org.gebish:geb-core:0.9
这里一定有更好的方法,对吧? (format t "Enter your age: ~%") (defun age-case (age) (case age (1 (format t "Y
如何在 do 循环中绑定(bind)从函数返回的多个值? 以下显然是非常错误的,但是这样的事情可能吗? (do (((x y z) (3-val-fn) (3-val-fn))) ((equa
所以我正在学习 Lisp 做分数,这很棒。但是为什么这个相等性检查返回 NIL: * (= 0.2 1/5) NIL ...如果转换为 float 则返回 True第一的: * (=
是否可以“统计”一个文件并找到它的文件类型 - 常规或目录? 最佳答案 阅读关于 portable pathname library 的章节来自 Peter Seibel 的 Practical Co
我是 CL 的新手,正在使用 AllegroCL。我试图弄清楚如何组织我的源代码以满足以下要求: 我想阻止 src 代码包含我的测试套件。 我想以可移植的方式声明项目依赖项(src 和 test de
谁能告诉我最新的标准化 Common Lisp 的文档是什么(应该遵循各种实现的文档)?我问是因为我可以在网上找到很多关于 CL 的书都来自 90 年代,所以我想知道它们是否是最新的。我也来自于在 R
假设我必须定义一个名为foo 的函数。假设,为了定义它,我使用了一些辅助函数 foo1, foo2, foo3, ... 当我加载包含这些函数的文件时,我可以从顶层使用所有这些函数。相反,我只想从顶层
这拒绝编译。注释掉 (setf roll行让它编译。然而,(setf roll...本身在 REPL 中正确评估。 程序: ;; loop n times ; sum up number of hit
我目前正在学习 Common Lisp,并尝试将一些 JSON 发送到网络服务。我要发送的 JSON 以类似于以下的结构表示: ((:ITEMS ((:KEY . "value1") (:IGNO
我有一个带波浪号的目录名(作为字符串):~/projects . 我想得到它的完整路径:/home/user/projects .我怎么做 ? 目标是将它传递给 uiop:run-program ,这
我想从输入文件中读取一个字符串(用户可能修改也可能没有修改)。我想将此字符串视为使用固定数量的参数调用的格式指令。但是,我知道某些格式指令(特别是我想到的 ~/)可能会用于注入(inject)函数调用
我是一名优秀的程序员,十分优秀!