summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/api/Symbols.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-07-21 22:03:00 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-07-22 09:21:26 +0200
commit59f1ee5989c43206676d831ff696b5d656ac6727 (patch)
treebafd0d17e35d25e89b3fdf0179fe7475175c8510 /src/reflect/scala/reflect/api/Symbols.scala
parent76c133d48602ce1e7caee87940148cc37f1366b1 (diff)
downloadscala-59f1ee5989c43206676d831ff696b5d656ac6727.tar.gz
scala-59f1ee5989c43206676d831ff696b5d656ac6727.tar.bz2
scala-59f1ee5989c43206676d831ff696b5d656ac6727.zip
Query methods in api.Symbols for Java flags
Adds query methods to the public reflection API for querying the JAVA_ENUM and JAVA_ANNOTATION flags. Didn't include JAVA_DEFAULTMETHOD because it does not correspond to a real java classfile flag (just a non-abstract method in an interface), and we want to clean the usage of this flag before adding it to a public API. The flags themselfs are not added to the reflection API. A comment in api/FlagSets.scala says: Q: I have a pretty flag. Can I put it here? A: Only if there's a tree that cannot be built without it. If you want to put a flag here so that it can be tested against, introduce an `isXXX` method in one of the api.Symbols classes instead.
Diffstat (limited to 'src/reflect/scala/reflect/api/Symbols.scala')
-rw-r--r--src/reflect/scala/reflect/api/Symbols.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala
index b7234ba47a..9e9fe5d67b 100644
--- a/src/reflect/scala/reflect/api/Symbols.scala
+++ b/src/reflect/scala/reflect/api/Symbols.scala
@@ -504,6 +504,18 @@ trait Symbols { self: Universe =>
*/
def isImplicit: Boolean
+ /** Does this symbol represent a java enum class or a java enum value?
+ *
+ * @group Tests
+ */
+ def isJavaEnum: Boolean
+
+ /** Does this symbol represent a java annotation interface?
+ *
+ * @group Tests
+ */
+ def isJavaAnnotation: Boolean
+
/******************* helpers *******************/
/** Provides an alternate if symbol is a NoSymbol.