jeudi 23 juillet 2015

Scala - How to get a wrapped method's name?

I have the following 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.")
    }
}

I'd like to get the simpleName of the method wich is being held by f. How can I do that?





Aucun commentaire:

Enregistrer un commentaire