Scala - 如何获取包装方法的名称?

时间:2015-07-23 16:11:09

标签: scala reflection wrapper

我有以下包装器:

def ProtectedAction[T](f: => T)(implicit user: User): T = {
    if(isAuthorized()) f
    else { 
        Logger.warn(user.login + "Had access denied to" + methodsName)
        throw new NotAuthorizedException("You do not have permission to execute this operation.")
    }
}

我想获得 f 所持有的方法的simpleName。我怎么能这样做?

0 个答案:

没有答案