forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Old Man Reflection is coming home and he's not going to like finding out a bunch of beans have moved into his reflecting room. We had better evict those guys before he blows his stack. scala.reflect.*Bean* --> scala.beans.* scala.beans, that's kind of a fancy package name for some beans. I figure it's time to start fishing or cutting bait on this kind of thing. I don't even know what beans are, but if we're going to have them in the mainline, the least surprising place to find them is scala.beans. If we don't want to put them in scala.beans for whatever reason, then I say they don't belong in trunk at all. Bonus round: scala.annotation.target --> scala.beans.meta I don't know if there is any more unfortunate name for a package possible than "target". Maybe ".svn" or ".git" if you could have dots in package names. Package CVS wouldn't hit too hard these days. Package lib_managed? I'll try to come up with something. In any case this golden opportunity could not be squandered. There is a new starr included, because GenJVM contains all kinds of shooting-from-the-hip Bean-related name hardcoding. (Yes, still. I ran out of stones. So a few birds escape with their lives... this time.)
- Loading branch information
Showing
34 changed files
with
171 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9361bf724565fdb20937e22c7dc4e6c67ff82221 ?scala-compiler.jar | ||
14a0987b7538c3aadcfa9160965076dfe118ec0d ?scala-compiler.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b0308ec2747d2e1614a000298dacccdd78e57c2d ?scala-library-src.jar | ||
6207899bfc2c03c7c9d014e332475eb313062e3c ?scala-library-src.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1489cddb0e70ade4a03766ab3f9811697294ab0a ?scala-library.jar | ||
f374329f89c77e8205a377060b21cf97ace5ac9b ?scala-library.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,29 @@ | ||
/* __ *\ | ||
** ________ ___ / / ___ Scala API ** | ||
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** | ||
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** | ||
** /____/\___/_/ |_/____/_/ | | ** | ||
** |/ ** | ||
\* */ | ||
|
||
package scala.annotation | ||
|
||
/** | ||
* When defining a field, the Scala compiler creates up to four accessors | ||
* for it: a getter, a setter, and if the field is annotated with | ||
* `@BeanProperty`, a bean getter and a bean setter. | ||
* | ||
* For instance in the following class definition | ||
* | ||
* {{{ | ||
* class C(@myAnnot @BeanProperty var c: Int) | ||
* }}} | ||
* | ||
* there are six entities which can carry the annotation `@myAnnot`: the | ||
* constructor parameter, the generated field and the four accessors. | ||
* | ||
* By default, annotations on (`val`-, `var`- or plain) constructor parameters | ||
* end up on the parameter, not on any other entity. Annotations on fields | ||
* by default only end up on the field. | ||
* | ||
* The meta-annotations in package `scala.annotation.target` are used | ||
* to control where annotations on fields and class parameters are copied. | ||
* This is done by annotating either the annotation type or the annotation | ||
* class with one or several of the meta-annotations in this package. | ||
* | ||
* ==Annotating the annotation type== | ||
* | ||
* The target meta-annotations can be put on the annotation type when | ||
* instantiating the annotation. In the following example, the annotation | ||
* `@Id` will be added only to the bean getter `getX`. | ||
* | ||
* {{{ | ||
* import javax.persistence.Id | ||
* class A { | ||
* @(Id @beanGetter) @BeanProperty val x = 0 | ||
* } | ||
* }}} | ||
* | ||
* In order to annotate the field as well, the meta-annotation `@field` | ||
* would need to be added. | ||
* | ||
* The syntax can be improved using a type alias: | ||
* | ||
* {{{ | ||
* object ScalaJPA { | ||
* type Id = javax.persistence.Id @beanGetter | ||
* } | ||
* import ScalaJPA.Id | ||
* class A { | ||
* @Id @BeanProperty val x = 0 | ||
* } | ||
* }}} | ||
* | ||
* ==Annotating the annotation class== | ||
* | ||
* For annotations defined in Scala, a default target can be specified | ||
* in the annotation class itself, for example | ||
* | ||
* {{{ | ||
* @getter | ||
* class myAnnotation extends Annotation | ||
* }}} | ||
* | ||
* This only changes the default target for the annotation `myAnnotation`. | ||
* When instantiating the annotation, the target can still be specified | ||
* as described in the last section. | ||
*/ | ||
package object target | ||
package object target { | ||
@deprecated("Use `@scala.beans.meta.beanGetter` instead", "2.10.0") | ||
type beanGetter = scala.beans.meta.beanGetter | ||
|
||
@deprecated("Use `@scala.beans.meta.beanSetter` instead", "2.10.0") | ||
type beanSetter = scala.beans.meta.beanSetter | ||
|
||
@deprecated("Use `@scala.beans.meta.field` instead", "2.10.0") | ||
type field = scala.beans.meta.field | ||
|
||
@deprecated("Use `@scala.beans.meta.getter` instead", "2.10.0") | ||
type getter = scala.beans.meta.getter | ||
|
||
@deprecated("Use `@scala.beans.meta.param` instead", "2.10.0") | ||
type param = scala.beans.meta.param | ||
|
||
@deprecated("Use `@scala.beans.meta.setter` instead", "2.10.0") | ||
type setter = scala.beans.meta.setter | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package scala.beans | ||
|
||
/** | ||
* When defining a field, the Scala compiler creates up to four accessors | ||
* for it: a getter, a setter, and if the field is annotated with | ||
* `@BeanProperty`, a bean getter and a bean setter. | ||
* | ||
* For instance in the following class definition | ||
* | ||
* {{{ | ||
* class C(@myAnnot @BeanProperty var c: Int) | ||
* }}} | ||
* | ||
* there are six entities which can carry the annotation `@myAnnot`: the | ||
* constructor parameter, the generated field and the four accessors. | ||
* | ||
* By default, annotations on (`val`-, `var`- or plain) constructor parameters | ||
* end up on the parameter, not on any other entity. Annotations on fields | ||
* by default only end up on the field. | ||
* | ||
* The meta-annotations in package `scala.beans.meta` are used | ||
* to control where annotations on fields and class parameters are copied. | ||
* This is done by annotating either the annotation type or the annotation | ||
* class with one or several of the meta-annotations in this package. | ||
* | ||
* ==Annotating the annotation type== | ||
* | ||
* The target meta-annotations can be put on the annotation type when | ||
* instantiating the annotation. In the following example, the annotation | ||
* `@Id` will be added only to the bean getter `getX`. | ||
* | ||
* {{{ | ||
* import javax.persistence.Id | ||
* class A { | ||
* @(Id @beanGetter) @BeanProperty val x = 0 | ||
* } | ||
* }}} | ||
* | ||
* In order to annotate the field as well, the meta-annotation `@field` | ||
* would need to be added. | ||
* | ||
* The syntax can be improved using a type alias: | ||
* | ||
* {{{ | ||
* object ScalaJPA { | ||
* type Id = javax.persistence.Id @beanGetter | ||
* } | ||
* import ScalaJPA.Id | ||
* class A { | ||
* @Id @BeanProperty val x = 0 | ||
* } | ||
* }}} | ||
* | ||
* ==Annotating the annotation class== | ||
* | ||
* For annotations defined in Scala, a default target can be specified | ||
* in the annotation class itself, for example | ||
* | ||
* {{{ | ||
* @getter | ||
* class myAnnotation extends Annotation | ||
* }}} | ||
* | ||
* This only changes the default target for the annotation `myAnnotation`. | ||
* When instantiating the annotation, the target can still be specified | ||
* as described in the last section. | ||
*/ | ||
package object meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.