在VB中转换java.util.List中的值,以字符串或其他正常格式 [英] converting values of java.util.list to string or other normal format in vb

查看:250
本文介绍了在VB中转换java.util.List中的值,以字符串或其他正常格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请,我在项目从Microsoft Project文件使用mpxj拉动。我能拉pdecessor在mpxj返回一个java.util.List类型的功能使用的建设$ P $的方式 - 我这变量保存为一个对象,但我需要找到一种方法,使这些数据的格式,我可以很容易地使用这样我就可以把它存储到数据库中。下面列出的是code线我使用拉从项目文件中的predecessors。

in my application, I am pulling in items from a microsoft project file using mpxj - one of the items I need is the predecessors. The way I am able to pull the predecessor is using a build in function of mpxj which returns a type of java.util.list - I can save this to variable as an object, but I need to find a way to bring the data to a format I can easily use so I can store it into a database. Listed below is the line of code I am using to pull the predecessors from the project file.

Dim predecessors = task.getPredecessors

和这里的结果把一个跟踪点时获得predecessors值

and here is the result when putting a tracepoint in to get the value of predecessors

[[Relation [Task id=4 uniqueID=45577 name=Standards Training - Round 2] -> [Task id=3 uniqueID=45576 name=Process Excellence Training]]]

即使我能得到上面的一个字符串,我可以用它工作足以让我需要的数据。上面的例子是那里是在predecessor清单项目1项,但有时也有多个项目。这里是当有多个项目的跟踪点的一个例子。

Even if I could get the above as a string, I could work with it enough to get the data I need. The above example is where there is 1 item in the predecessor list, but sometimes there are multiple items. Here is an example of the tracepoint when there are multiple items.

[[Relation [Task id=63 uniqueID=45873 name=Complete IP Binder] -> [Task id=47 uniqueID=45857 name=Organizational Assessment]], [Relation [Task id=63 uniqueID=45873 name=Complete IP Binder] -> [Task id=49 uniqueID=45859 name=Document Deliverables]], [Relation [Task id=63 uniqueID=45873 name=Complete IP Binder] -> [Task id=56 uniqueID=45866 name=Infrastructure Deliverables]], [Relation [Task id=63 uniqueID=45873 name=Complete IP Binder] -> [Task id=58 uniqueID=45868 name=IT Deliverables]], [Relation [Task id=63 uniqueID=45873 name=Complete IP Binder] -> [Task id=60 uniqueID=45870 name=Organizational Deliverables]]]

感谢您的帮助。

推荐答案

能够使用的toString然后右键来完成这一点,并留下来切出我需要什么,更快 - 不知道为什么,这是之前

was able to complete this by using tostring then right and left to cut out what i need, much quicker - dont know why this was deleted before

这篇关于在VB中转换java.util.List中的值,以字符串或其他正常格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆