简体   繁体   English

在Java LS2J中使用getter和setter

[英]use getter and setter in java LS2J

I have problem with the getter in LS2J, i can't have the result of the get in my prog !! 我在LS2J中的吸气剂有问题,我无法获得编入中的结果! I take some tests, this is the results : 我进行了一些测试,这是结果:


My class in java : 我在java中的课程:

public String getFonctionWS() {

    System.out.println("get : " + fonctionWS);
    return fonctionWS;
}
public void setFonctionWS(String fonctionWS) {

    System.out.println("set : " + fonctionWS);
    this.fonctionWS = fonctionWS;
}

This same class called in LS2J : LS2J中调用了相同的类:

Class LogWSDTO
sessionJava As JAVASESSION      
classJava As JAVACLASS
objectJava As JAVAOBJECT        
methodJava As JAVAMETHOD


Public Sub New()
    Set sessionJava = New JAVASESSION
    Set classJava = sessionJava.GetClass("com.pasquier.DTO.WS/LogWSDTO")
    Set objectJava = classJava.CreateObject     
End Sub

Public function getFonctionWS()
    Set methodJava = classJava.GetMethod("getFonctionWS","()Ljava/lang/String;")        
    getFonctionWS = objectJava.getFonctionWS        
End function

I call this class in lotus : 我在莲花课上称这堂课:

 Dim session As NotesSession


    logDTO.setFonctionWS("GetAllDocuments")         
    dt = logDTO.getFonctionWS

the result print : set : GetAllDocuments 结果打印:设置:GetAllDocuments

Agent 'GetAllDocuments_LogWS GADBKWS' error: Wrong number of arguments for method 代理“ GetAllDocuments_LogWS GADBKWS”错误:方法的参数数量错误

Sorry if i'm not very clear ^^ I have several problems and i was difficulty to explain one by one... thanks for your help ! 抱歉,如果我不太清楚^^我有几个问题,我很难一一解释...谢谢您的帮助!

i begin to understand : in ls2j for get the getter, we must take a parameter ... !!!!(????) 我开始理解:在ls2j中获取吸气剂,我们必须采用一个参数... !!!!(????)

when i try : 当我尝试时:

public String getEssai(String dt){
    System.out.println("get essai test20002");

    return fonctionWS;
}

it' fine, i have my result !! 很好,我有我的结果! i don't understand why but it works !! 我不明白为什么,但是它有效!

could you explain me ?? 你能解释一下我吗?

它应该是:

getFonctionWS = objectJava.getFonctionWS()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM