Trait scala.reflect.api.FlagSets
trait FlagSets extends AnyRef
Type Members
trait FlagOps extends Any
Concrete Value Members
final def !=(arg0: Any): Boolean
final def ##(): Int
def +(other: String): String
def ->[B](y: B): (FlagSets, B)
final def ==(arg0: Any): Boolean
final def asInstanceOf[T0]: T0
def clone(): AnyRef
def ensuring(cond: (FlagSets) => Boolean, msg: => Any): FlagSets
def ensuring(cond: (FlagSets) => Boolean): FlagSets
def ensuring(cond: Boolean, msg: => Any): FlagSets
def ensuring(cond: Boolean): FlagSets
final def eq(arg0: AnyRef): Boolean
def equals(arg0: AnyRef): Boolean
def finalize(): Unit
final def getClass(): Class[_ <: AnyRef]
def hashCode(): Int
final def isInstanceOf[T0]: Boolean
final def ne(arg0: AnyRef): Boolean
final def notify(): Unit
final def notifyAll(): Unit
final def synchronized[T0](arg0: => T0): T0
def toString(): String
final def wait(): Unit
final def wait(arg0: Long, arg1: Int): Unit
final def wait(arg0: Long): Unit
EXPERIMENTAL
The trait that defines flag sets and operations on them.
Flag
s are used to provide modifiers for abstract syntax trees that represent definitions via theflags
field of scala.reflect.api.Trees#Modifiers. Trees that accept modifiers are:For example, to create a class named
C
one would write something like:Here, the flag set is empty.
To make
C
private, one would write something like:Flags can also be combined with the vertical bar operator (
|
). For example, a private final class is written something like:The list of all available flags is defined in scala.reflect.api.FlagSets#FlagValues, available via scala.reflect.api.FlagSets#Flag. (Typically one writes a wildcard import for this, e.g.
import scala.reflect.runtime.universe.Flag._
).Definition trees are compiled down to symbols, so flags on modifiers of these trees are transformed into flags on the resulting symbols. Unlike trees, symbols don't expose flags, but rather provide
isXXX
test methods (e.g.isFinal
can be used to test finality). These test methods might require an upcast withasTerm
,asType
orasClass
as some flags only make sense for certain kinds of symbols.Of Note: This part of the Reflection API is being considered as a candidate for redesign. It is quite possible that in future releases of the reflection API, flag sets could be replaced with something else.
For more details about
FlagSet
s and other aspects of Scala reflection, see the Reflection Guide