- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.xmlpull.v1.builder.XmlInfosetBuilder
类的一些代码示例,展示了XmlInfosetBuilder
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlInfosetBuilder
类的具体详情如下:
包路径:org.xmlpull.v1.builder.XmlInfosetBuilder
类名称:XmlInfosetBuilder
[英]By default builder is using non-validating pull parser with next() method without namespaces to build tree consisting only of XmlDocument, XmlElemenet and String nodes. Additional options are available to change builder behaviour and to generate any deseired subset of XML Information Set
[中]默认情况下,生成器使用不带名称空间的next()方法的非验证性pull parser来构建只包含XmlDocument、XmlElemenet和String节点的树。其他选项可用于更改生成器行为和生成XML Information Set的任何已设计子集
代码示例来源:origin: xpp3/xpp3
/**
* Create a new document.
*/
public XmlDocument newDocument() throws XmlBuilderException {
return newDocument(null, null, null);
}
代码示例来源:origin: org.ogce/xpp3
public Object getDocument(String url) throws FunctionCallException
{
try
{
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
return builder.parseLocation( url );
}
catch (Exception e)
{
throw new FunctionCallException( e.getMessage() );
}
}
}
代码示例来源:origin: org.apache.airavata/airavata-common-utils
/**
* Parses a specified string and returns the XmlElement (XPP3).
*
* @param string
* @return The XmlElement (XPP3) parsed.
*/
public static org.xmlpull.v1.builder.XmlElement stringToXmlElement3(String string) {
return BUILDER3.parseFragmentFromReader(new StringReader(string));
}
代码示例来源:origin: org.ogce/xpp3
boolean useUrl = pos >= 0 && pos < 6; //simple heuristic to find "http://" and similiar
try {
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
XmlDocument doc = useUrl ? builder.parseLocation( location )
: builder.parseReader(new StringReader( location ) );
Object infosetItem = resultsIter.next();
System.out.println("----------------------------------"); //+ infosetItem.getClass());
System.out.println(builder.serializeToString(infosetItem)); //what about attributes, namespaces????
代码示例来源:origin: org.apache.airavata/common-utils
/**
* Returns the XML string of a specified XmlElement.
*
* @param element
* The specified XmlElement
* @return The XML string
*/
public static String xmlElementToString(org.xmlpull.v1.builder.XmlElement element) {
MXSerializer serializer = new MXSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, INDENT);
BUILDER3.serialize(element, serializer);
String xmlText = writer.toString();
return xmlText;
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse input stream to create XML document using specified encoding.
*
* @param is an InputStream
* @param encoding a String
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseInputStream(InputStream is, String encoding) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, encoding);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream (encoding="+encoding+")", e);
}
return parse(pp);
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse input stream to create XML fragment.
*
* @param is an InputStream
*
* @return a XmlElement
*
* @exception XmlBuilderException
*
*/
public XmlElement parseFragmentFromInputStream(InputStream is) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, null);
//set options ...
try {
pp.nextTag();
} catch (IOException e) {
throw new XmlBuilderException(
"IO error when starting to parse input stream", e);
}
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream", e);
}
return parseFragment(pp);
}
代码示例来源:origin: org.apache.airavata/airavata-workflow-engine
private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
throws ComponentRegistryException {
XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
if (value instanceof String) {
paramsElem.addChild(value);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
String[] list = (String[]) value;
for (int i = 0; i < list.length; i++) {
XmlElement item = builder.newFragment("value");
item.addChild(list[i]);
paramsElem.addChild(item);
代码示例来源:origin: org.ogce/xpp3
public void testSelection() throws Exception
{
XPath xpath = new Xb1XPath( "/foo/bar/baz" );
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
XmlDocument doc = builder.parseReader( new StringReader( BASIC_XML ));
List results = xpath.selectNodes( doc );
assertEquals( 3,
results.size() );
Iterator iter = results.iterator();
assertEquals( "baz",
((XmlElement)iter.next()).getName() );
assertEquals( "baz",
((XmlElement)iter.next()).getName() );
assertEquals( "baz",
((XmlElement)iter.next()).getName() );
assertTrue( ! iter.hasNext() );
}
}
代码示例来源:origin: xpp3/xpp3
/**
* Serialize item using default UTF8 encoding.
*
* @see serializeItem
*/
public void serializeToOutputStream(Object item, //XmlContainer node,
OutputStream os)
throws XmlBuilderException
//throws XmlPullParserException, IOException, IllegalArgumentException
{
serializeToOutputStream(item, os, "UTF8");
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
/**
*
* @param portTypeQName
* @param wsdl
* @param nodeID
* @param messageBoxURL
* @param gfacURL
* @param notifier
*/
public GenericInvoker(QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
String gfacURL, WorkflowNotifiable notifier) {
final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
this.nodeID = nodeID;
this.portTypeQName = portTypeQName;
this.wsdlDefinitionObject = wsdl;
this.messageBoxURL = messageBoxURL;
this.serviceInformation = wsdlStr;
this.gfacURL = gfacURL;
this.notifier = notifier.createServiceNotificationSender(nodeID);
this.failerSent = false;
this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
this.topic = notifier.getTopic();
}
代码示例来源:origin: org.apache.airavata/airavata-common-utils
/**
* Returns the XML string of a specified XmlElement.
*
* @param element
* The specified XmlElement
* @return The XML string
*/
public static String xmlElementToString(org.xmlpull.v1.builder.XmlElement element) {
MXSerializer serializer = new MXSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
serializer.setProperty(PROPERTY_SERIALIZER_INDENTATION, INDENT);
BUILDER3.serialize(element, serializer);
String xmlText = writer.toString();
return xmlText;
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse reader to create XML document.
*
* @param reader a Reader
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseReader(Reader reader) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(reader);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input from reader", e);
}
return parse(pp);
}
代码示例来源:origin: xpp3/xpp3
/**
* Parse reader to create XML fragment.
*
* @param reader a Reader
*
* @return a XmlElement
*
* @exception XmlBuilderException
*
*/
public XmlElement parseFragmentFromReader(Reader reader) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(reader);
//set options ...
try {
pp.nextTag();
} catch (IOException e) {
throw new XmlBuilderException(
"IO error when starting to parse from reader", e);
}
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input from reader", e);
}
return parseFragment(pp);
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
throws ComponentRegistryException {
XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
if (value instanceof String) {
paramsElem.addChild(value);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
Iterator arrayValues = list.iterator();
while (arrayValues.hasNext()) {
XmlElement item = builder.newFragment("value");
item.addChild(arrayValues.next());
paramsElem.addChild(item);
String[] list = (String[]) value;
for (int i = 0; i < list.length; i++) {
XmlElement item = builder.newFragment("value");
item.addChild(list[i]);
paramsElem.addChild(item);
代码示例来源:origin: org.ogce/xpp3
/**
* Serialize item using default UTF8 encoding.
*
* @see serializeItem
*/
public void serializeToOutputStream(Object item, //XmlContainer node,
OutputStream os)
throws XmlBuilderException
//throws XmlPullParserException, IOException, IllegalArgumentException
{
serializeToOutputStream(item, os, "UTF8");
}
代码示例来源:origin: xpp3/xpp3
/**
* Serialize item to given writer.
*
* @param item an Object
* @param writer a Writer
*
* @exception XmlBuilderException
*
*/
public void serializeToWriter(Object item, //XmlContainer node,
Writer writer)
//throws XmlPullParserException, IOException, IllegalArgumentException
throws XmlBuilderException
{
XmlSerializer ser = null;
try {
ser = factory.newSerializer();
ser.setOutput(writer);
} catch (Exception e) {
throw new XmlBuilderException("could not serialize node to writer", e);
}
serialize(item, ser);
try {
ser.flush();
} catch (IOException e) {
throw new XmlBuilderException("could not flush output", e);
}
}
代码示例来源:origin: xpp3/xpp3_xpath
public Object getDocument(String url) throws FunctionCallException
{
try
{
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
return builder.parseLocation( url );
}
catch (Exception e)
{
throw new FunctionCallException( e.getMessage() );
}
}
}
代码示例来源:origin: org.ogce/xpp3
/**
* Parse input stream to create XML document.
*
* @param is an InputStream
*
* @return a XmlDocument
*
* @exception XmlBuilderException
*
*/
public XmlDocument parseInputStream(InputStream is) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, null);
//set options ...
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream", e);
}
return parse(pp);
}
代码示例来源:origin: org.ogce/xpp3
/**
* Parse input stream to create XML fragment.
*
* @param is an InputStream
*
* @return a XmlElement
*
* @exception XmlBuilderException
*
*/
public XmlElement parseFragmentFromInputStream(InputStream is) throws XmlBuilderException
{
XmlPullParser pp = null;
try {
pp = factory.newPullParser();
pp.setInput(is, null);
//set options ...
try {
pp.nextTag();
} catch (IOException e) {
throw new XmlBuilderException(
"IO error when starting to parse input stream", e);
}
} catch (XmlPullParserException e) {
throw new XmlBuilderException("could not start parsing input stream", e);
}
return parseFragment(pp);
}
我正在开发一个应用程序,我成功地消除了除一个错误之外的所有错误: no suitable constructor found for builder 更改为“意图” https://file.io/O
我可以在 C++Builder 6 中成功编译以下代码片段,但我无法在 RAD Studio Seattle 中编译它: unsigned long x = 50; String s = In
我有一个项目(新开始),其中 C++ Builder 没有在任何断点处停止。我已确保我处于 Debug模式(未发布),链接器->完整调试信息 = True,C++ 编译器->调试配置,C++ 编译器-
我们想在正在开发的 C++ builder XE 应用程序中绘制大型控制流程图。 这些图表将以编程方式生成并以交互方式显示给用户(用户可以滚动大流程图、选择节点等)。节点必须能够显示自定义组件(如 T
我有以下问题 午餐时 FlashBuilder.exe (BURRITO):它崩溃并创建一个错误日志文件,例如: hs_err_pid7084.log 及以下 但是当我咀嚼 FlashBuilderC
我有一个大型 Flash Builder 项目,它是更大 (.net) 解决方案的一部分。对于整个项目,我通常有一个前进的开发分支,以及一个或多个错误修复分支。考虑到 Flash Builder 不想
乘数(自动布局中约束的属性)有什么作用? 最佳答案 约束中两个值之间的关系由以下公式确定: b = am + c 其中 a 和 b 是要关联的两个值,m 是乘数,c code> 是常量。 例如,如果
我们的开发团队使用 Borland C++ Builder 6 和 CodeGear C++ Builder 2007(以及 Visual Studio)。我听到很多评论说 Builder 2007
我想阐明我对构建器模式的使用,特别是构建器类型是如何创建的。在示例中,它只是假定构建器的类型并创建它。但是,我在“ChartBuilderFactory”类中创建了一个 CreateBuilder 方
首先,我对 Java 比较陌生,所以我问的可能是微不足道的,但我在这里或其他地方找不到答案。 为简单起见,假设我有以下类层次结构: class Shape { protected Shape(
我试图在另一个 AlertDialog 中打开一个 AlertDialog,但它不起作用,知道为什么它不起作用吗? String items[] = {"Details","Edit","Delete
我有一个包含 Form1 和 Form2 的程序。如何单击按钮从 form1 打开 form2? 最佳答案 更多信息 在你的 Project.cpp 中有这个:Application->CreateF
每当我使用 C++ Builder(XE4 版,但以前的版本也这样做)在 Release模式下构建 Win32 EXE 时,它总是创建一个导出目录并为我的项目中的每个单元导出一个 Initialize
我正在尝试在我的试用版 flashbuilder 上启用设计模式,但找不到任何选项, 我已经查看了 Windows 菜单,但没有启用设计模式, 和首选项,但首选项对话框中没有 Flex 来启用其设计模
我目前正在将一个大型 RAD Studio 2010 项目迁移到 XE4。作为其中的一部分,我正在重新创建许多项目文件。我想借此机会确保我们对预编译头使用最好的机制,因为似乎有几种方法可以做到这一点。
我观看了“Interface Builder 中的新增功能” session 视频并尝试复制显示的代码,但不幸的是,当我将 View 分配给具有 @IBDesignable 的自定义类时,出现 2 个
这个问题在这里已经有了答案: Why is NotificationCompat needed? (3 个答案) 关闭 5 年前。 我看到的几乎所有 Android 通知示例代码似乎都使用了 Not
我正在使用 fcm 从我的 Android 应用程序发送通知,并且我已经实现了它要求我提供的所有库。 val topic = "highScores" // See docum
我正在尝试在Flash Builder 4.6中进行项目范围内的查找和替换,但是对我而言,如何实现这一点并不明显。 我试过Edit-> Find/Replace然后全部替换,但它仅替换当前打开的文件中
帮助我在 XCode4 中取消 fubar 界面构建器。 我在 interface-builder 中创建了一个按钮,并在 View 的代码中为它定义了一个 IBAction 方法。它运行良好。然后我
我是一名优秀的程序员,十分优秀!