diff options
-rw-r--r-- | src/library/scala/reflect/BeanProperty.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/library/scala/reflect/BeanProperty.scala b/src/library/scala/reflect/BeanProperty.scala index c30c05db18..beba9fa418 100644 --- a/src/library/scala/reflect/BeanProperty.scala +++ b/src/library/scala/reflect/BeanProperty.scala @@ -11,4 +11,24 @@ package scala.reflect +/** + * This attribute adds a setter and a getter method, following the + Java Bean convention (first letter of the property is capitalized) used +by popular Java web frameworks. +For example +<pre> + [BeanProperty] + var status = "" +</pre> +<p> adds the following methods to the <b>generated</b> code </p> +<pre> + def setStatus(s:String): Unit = { this.status = s } + def getStatus: String = { this.status } +</pre> + * + <p> + However, you cannot call <code>setStatus</code> from Scala, you should + use the normal Scala access and assignment. + </p> + */ class BeanProperty extends Attribute |