scala.reflect.runtime

JavaToScala

trait JavaToScala extends ConversionUtil

Self Type
SymbolTable
Source
JavaToScala.scala
Linear Supertypes
ConversionUtil, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JavaToScala
  2. ConversionUtil
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringfmt
  2. by any2stringadd
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class TwoWayCache[J, S] extends AnyRef

    A cache that maintains a bijection between Java reflection type J and Scala reflection type S.

Abstract Value Members

  1. abstract val classLoader: ClassLoader

    Defines the classloader that will be used for all class resolution activities in this mirror.

    Defines the classloader that will be used for all class resolution activities in this mirror. Is mutable, since sometimes we need to change it in flight (e.g. to make the default mirror work with REPL).

    If you want to have a mirror with non-standard class resolution, override this var (or, even simpler, use the mkMirror function from scala.reflect package)

    Be careful, though, since fancy stuff might happen. Here's one example:

    partest uses a URLClassLoader(urls, null) with custom classpath to run workers (in separate threads) however it doesn't set the context classloader for them, so they inherit the system classloader http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html

    Once upon a time, scala.reflect.mirror was loaded using getClass.getClassLoader, which also means that classOf[...] constructs such as:

    classOf[scala.reflect.ScalaSignature]

    in unpickleClass were also loaded by the URLClassLoader

    But mirror's classLoader used Thread.currentThread.getContextClassLoader, which introduced a subtle bug that made the following snippet incorrectly:

    jclazz.getAnnotation(classOf[scala.reflect.ScalaSignature])

    Indeed, jclazz was loaded by context classloader, which defaulted to system classloader, while ScalaSignature class was loaded by getClass.getClassLoader, which was incompatible with system classloader. As a result, unpickler couldn't see the signature and that blew up the mirror.

  2. abstract def transformedType(sym: Symbol): Type

    the type of this symbol after Scala -> Java transformsi in refChecks, uncurry, erasure

    the type of this symbol after Scala -> Java transformsi in refChecks, uncurry, erasure

    Definition Classes
    ConversionUtil
  3. abstract def typeToJavaClass(tpe: Type): Class[_]

    The Java class thaty given type compiles to

    The Java class thaty given type compiles to

    Definition Classes
    ConversionUtil

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from JavaToScala to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (JavaToScala, B)

    Implicit information
    This member is added by an implicit conversion from JavaToScala to ArrowAssoc[JavaToScala] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val classCache: TwoWayCache[Class[_], Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  10. def classToScala(jclazz: Class[_]): Symbol

    The Scala class that corresponds to a given Java class.

    The Scala class that corresponds to a given Java class.

    jclazz

    The Java class

    returns

    A Scala class symbol that reflects all elements of the Java class, in the form they appear in the Scala pickling info, or, if that is not available, wrapped from the Java reflection info.

  11. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def constrToScala(jconstr: java.lang.reflect.Constructor[_]): Symbol

    The Scala constructor corresponding to given Java constructor.

    The Scala constructor corresponding to given Java constructor.

    jconstr

    The Java constructor

    returns

    A Scala method object that corresponds to jconstr.

  13. val constructorCache: TwoWayCache[java.lang.reflect.Constructor[_], Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  14. def ensuring(cond: (JavaToScala) ⇒ Boolean, msg: ⇒ Any): JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to Ensuring[JavaToScala] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: (JavaToScala) ⇒ Boolean): JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to Ensuring[JavaToScala] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean, msg: ⇒ Any): JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to Ensuring[JavaToScala] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean): JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to Ensuring[JavaToScala] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  20. def erasesTo(meth: Symbol, jconstr: java.lang.reflect.Constructor[_]): Boolean

    Does constructor meth erase to Java method jconstr? This is true if the Java constructor type is the same as the Scala constructor type after performing all Scala-specific transformations in InfoTransformers.

    Does constructor meth erase to Java method jconstr? This is true if the Java constructor type is the same as the Scala constructor type after performing all Scala-specific transformations in InfoTransformers. (to be done)

    Attributes
    protected
    Definition Classes
    ConversionUtil
  21. def erasesTo(meth: Symbol, jmeth: Method): Boolean

    Does method meth erase to Java method jmeth? This is true if the Java method type is the same as the Scala method type after performing all Scala-specific transformations in InfoTransformers.

    Does method meth erase to Java method jmeth? This is true if the Java method type is the same as the Scala method type after performing all Scala-specific transformations in InfoTransformers. (to be done)

    Attributes
    protected
    Definition Classes
    ConversionUtil
  22. val fieldCache: TwoWayCache[Field, Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  23. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from JavaToScala to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. def genericDeclarationToScala(jdecl: GenericDeclaration): Symbol

    The Scala symbol that corresponds to a given Java generic declaration (class, method, or constructor)

  26. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. def isJavaClass(path: String): Boolean

    Does path correspond to a Java class with that fully qualified name?

  30. def javaClass(path: String, classLoader: ClassLoader): Class[_]

  31. def javaClass(path: String): Class[_]

    Paul: It seems the default class loader does not pick up root classes, whereas the system classloader does.

    Paul: It seems the default class loader does not pick up root classes, whereas the system classloader does. Can you check with your newly acquired classloader fu whether this implementation makes sense?

  32. def makeScalaPackage(fullname: String): Symbol

    The Scala package with given fully qualified name.

    The Scala package with given fully qualified name. Unlike packageNameToScala, this one bypasses the cache.

  33. val methodCache: TwoWayCache[Method, Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  34. def methodToScala(jmeth: Method): Symbol

    The Scala method corresponding to given Java method.

    The Scala method corresponding to given Java method.

    jmeth

    The Java method

    returns

    A Scala method object that corresponds to jmeth.

  35. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. val packageCache: TwoWayCache[Package, Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  39. def packageNameToScala(fullname: String): Symbol

    The Scala package with given fully qualified name.

  40. def packageToScala(jpkg: Package): Symbol

    The Scala package corresponding to given Java package

  41. var parentsLevel: Int

    used to avoid cyclies

  42. var pendingLoadActions: List[() ⇒ Unit]

  43. val self: Any

    Implicit information
    This member is added by an implicit conversion from JavaToScala to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
  44. val self: Any

    Implicit information
    This member is added by an implicit conversion from JavaToScala to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. def toString(): String

    Definition Classes
    AnyRef → Any
  47. val tparamCache: TwoWayCache[java.lang.reflect.TypeVariable[_], Symbol]

    Attributes
    protected
    Definition Classes
    ConversionUtil
  48. def tparamToScala(jparam: java.lang.reflect.TypeVariable[_ <: java.lang.reflect.GenericDeclaration]): Symbol

    The Scala type parameter that corresponds to a given Java type parameter.

    The Scala type parameter that corresponds to a given Java type parameter.

    jparam

    The Java type parameter

    returns

    A Scala type parameter symbol that has the same owner and name as the Java type parameter

  49. def typeToScala(jtpe: Type): Type

    The Scala type that corresponds to given Java type

  50. def unpickleClass(clazz: Symbol, module: Symbol, jclazz: Class[_]): Unit

    Generate types for top-level Scala root class and root companion object from the pickled information stored in a corresponding Java class

    Generate types for top-level Scala root class and root companion object from the pickled information stored in a corresponding Java class

    clazz

    The top-level Scala class for which info is unpickled

    module

    The top-level Scala companion object for which info is unpickled

    jclazz

    The Java class which contains the unpickled information in a ScalaSignature or ScalaLongSignature annotation.

  51. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  52. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  53. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  54. def [B](y: B): (JavaToScala, B)

    Implicit information
    This member is added by an implicit conversion from JavaToScala to ArrowAssoc[JavaToScala] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def x: JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to ArrowAssoc[JavaToScala] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: JavaToScala

    Implicit information
    This member is added by an implicit conversion from JavaToScala to Ensuring[JavaToScala] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from ConversionUtil

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringfmt from JavaToScala to StringFormat

Inherited by implicit conversion any2stringadd from JavaToScala to StringAdd

Inherited by implicit conversion any2ArrowAssoc from JavaToScala to ArrowAssoc[JavaToScala]

Inherited by implicit conversion any2Ensuring from JavaToScala to Ensuring[JavaToScala]