Get name of class-attribute or class-function as String

Posted by ifischer on Stack Overflow See other posts from Stack Overflow or by ifischer
Published on 2010-06-10T18:39:50Z Indexed on 2010/06/10 18:42 UTC
Read the original article Hit count: 317

Filed under:
|

Say i have the following class:

class Person {
  @BeanProperty
  var firstName: String = _
}

Is it possible to get the String representation of "firstName" in a type-safe way, by reflection or something? Or the String representation of the generated "getFirstName"-Function?

© Stack Overflow or respective owner

Related posts about scala

Related posts about scala-2.8