Skip to content

Instantly share code, notes, and snippets.

@pichsenmeister
Created August 6, 2013 19:25
Show Gist options
  • Save pichsenmeister/6167736 to your computer and use it in GitHub Desktop.
Save pichsenmeister/6167736 to your computer and use it in GitHub Desktop.
scala reflection: invoking a method
def invokeMethod(param: String) = {
val im =mirror.reflect(getObjectInstance("models.entities.User"))
val method = im.symbol.typeSignature.member(newTermName("findByUsername")).asMethod
im.reflectMethod(method)(param)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment