2012-09-26 88 views
-2

我想将以下Java代码转换为Jython代码。我不太了解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(); 
    } 
}); 

你能帮我做这个任务吗?

回答

1
def execute(access): 
    return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName() 

name = connection.runReadAction(readActionResult=execute) 

Jython处理创建匿名内部类的混乱细节。