Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

common lisp - Using enums with LispWorks' Java interface

I'm trying to use the EWS Java library (link) with LispWorks 7.1.2 Win32's Java interface. I am somewhat familiar with basic Java concepts but have no experience with the Java language. This is the code I am trying to mimic:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);

So I figured I would create an ExchangeVersion object (which is an enum), set it to the value "Exchange2010_SP2", and pass it to another create-java-object expression for the ExchangeService object.

This was my first step:

(create-java-object "microsoft.exchange.webservices.data.core.ExchangeService"
 "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion.Exchange2010_SP2")

However, I get the following error message: constructor of microsoft/exchange/webservices/data/core/ExchangeService first arguments is wrong type, wanted microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion got "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion.Exchange2010_SP2"

OK, so then I tried this:

(create-java-object "microsoft.exchange.webservices.data.core.ExchangeService"
"microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion")

which gave me the error: constructor of microsoft/exchange/webservices/data/core/ExchangeService first arguments is wrong type, wanted microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion got "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion". Which doesn't make much sense to me. So finally I tried to create a standalone ExchangeVersion object:

(create-java-object "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion")

which led to this error message: CREATE-JAVA-OBJECT: : Failed to find constructors for class "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion".

I wonder if anyone have suggestions on what am I doing wrong?

Many Thanks!

question from:https://stackoverflow.com/questions/65829612/using-enums-with-lispworks-java-interface

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...