大哥们,那个又对vb熟悉一点的啊,看看我这个vo怎么写成vb的类模块(200分)

  • 主题发起人 主题发起人 Wafer
  • 开始时间 开始时间
W

Wafer

Unregistered / Unconfirmed
GUEST, unregistred user!
小弟做webservices,vb做客户端,发布成webservices服务的接口是一个复杂类型,值对象数组,所小弟需要在vb里面写一个,类模块。
public class VO_EndTaskRequestInfo implements Serializable {
private String taskid;
private VO_ShareDataItem[] sharedata;
public VO_EndTaskRequestInfo() {
}
public String getTaskid() {
return taskid;
}
public void setTaskid(String taskid) {
this.taskid = taskid;
}
public VO_ShareDataItem[] getSharedata() {
return sharedata;
}
public void setSharedata(VO_ShareDataItem[] sharedata) {
this.sharedata = sharedata;
}
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
}
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
}
}
........................................................
public class VO_ShareDataItem implements Serializable {
private String itemname;
private String itemtype;
private String itemvalue;
public VO_ShareDataItem() {
}
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
public String getItemtype() {
return itemtype;
}
public void setItemtype(String itemtype) {
this.itemtype = itemtype;
}
public String getItemvalue() {
return itemvalue;
}
public void setItemvalue(String itemvalue) {
this.itemvalue = itemvalue;
}
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
}
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
}
}
..................................................
VO_ShareDataItem 类模块
Public itemname As String
Public itemtype As String
Public itemvalue As String
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
VO_EndTaskRequestInfo 类模块
Public taskid As String
Private sharedata() As VO_ShareDataItem //这里要是一个对象数组,VO_ShareDataItem类型的值对象数组
下面得get,set方法要怎么写啊
我写get方法,这个好像对咯
Public Property Set VO_ShareDataItem(ByVal value As VO_ShareDataItem)
Set sharedata() = value
End Property
我写得set方法,不过写错咯.
Public Property Get VO_ShareDataItem() As VO_ShareDataItem
If sharedata() Is Nothing then
Set sharedata() = New VO_ShareDataItem
Set VO_ShareDataItem() = sharedata()
End Property

这个类模块要怎么写啊,那位大哥救我啊.
 
我写一个你看看.
Private WithEvents RS As ADODB.RecordSet
Public Property Get DataSource() As DataSource
Set DataSource = RS.DataSource
End Property
Public Property Set DataSource(ByVal objDataSource As DataSource)
Set RS.DataSource = objDataSource
PropertyChanged "DataSource"
End Property
//下面是你的
Public Property Set VO_ShareDataItem(ByVal value As VO_ShareDataItem)
Set sharedata() = value
End Property
Public Property Get VO_ShareDataItem() As VO_ShareDataItem
If sharedata() Is Nothing then
Set sharedata() = New VO_ShareDataItem
Set VO_ShareDataItem() = sharedata()
PropertyChanged "VO_ShareDataItem"
End Property
完成了!
 
后退
顶部