我想将以下Java代码转换为Jython代码。我对Java知之甚少。
String name = connection.runReadAction(new ReadActionResult<String>()
{
public String execute(SystemAccess access) throws Exception
{
return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName();
}
});
你能帮我做这个任务吗?
答案 0 :(得分:1)
def execute(access):
return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName()
name = connection.runReadAction(readActionResult=execute)
Jython处理创建匿名内部类的混乱细节。