Trait scala.reflect.api.Names
trait Names extends AnyRef
Abstract Value Members
abstract val TermName:
abstract val TypeName:
abstract def newTermName(s: String): TermName
abstract def newTypeName(s: String): TypeName
Concrete Value Members
final def !=(arg0: Any): Boolean
final def ##(): Int
def +(other: String): String
def ->[B](y: B): (Names, B)
final def ==(arg0: Any): Boolean
final def asInstanceOf[T0]: T0
def clone(): AnyRef
def ensuring(cond: (Names) => Boolean, msg: => Any): Names
def ensuring(cond: (Names) => Boolean): Names
def ensuring(cond: Boolean, msg: => Any): Names
def ensuring(cond: Boolean): Names
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
This trait defines
Names in Scala Reflection, and operations on them.Names are simple wrappers for strings. Name has two subtypes TermName and TypeName which distinguish names of terms (like objects or members) and types. A term and a type of the same name can co-exist in an object.
To search for the
mapmethod (which is a term) declared in theListclass, one can do:scala> typeOf[List[_]].member(TermName("map")) res0: reflect.runtime.universe.Symbol = method mapTo search for a type member, one can follow the same procedure, using
TypeNameinstead.For more information about creating and using
Names, see the Reflection Guide: Annotations, Names, Scopes, and More