Object

com.salesforce.op.utils.reflection

ReflectionUtils

Related Doc: package reflection

Permalink

object ReflectionUtils

Various Reflection helpers

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReflectionUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bestCtorWithArgs[T](instance: T, classLoader: ClassLoader = defaultClassLoader)(implicit arg0: ClassTag[T]): (scala.reflect.api.JavaUniverse.MethodMirror, List[(String, Any)])

    Permalink

    Use reflection to get the primary constructor definition of an instance.

    Use reflection to get the primary constructor definition of an instance. Along with the constructor Mirror, this will also search the instance mirror for the appropriate members and their values used as arguments to the constructor.

    T

    type of instance to copy

    instance

    instance to make copy from

    classLoader

    class loader to use

    returns

    a tuple where the first element is the Constructor Mirror, and the second element is a List of tuples containing the member names and their values

  6. def classForName(name: String, classLoader: ClassLoader = defaultClassLoader): Class[_]

    Permalink

    Find the class by name

    Find the class by name

    name

    class name

    classLoader

    class loader to use

    returns

    class object

    Exceptions thrown
  7. def classTagForWeakTypeTag[T](implicit arg0: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): ClassTag[T]

    Permalink

    Create a ClassTag for a WeakTypeTag

    Create a ClassTag for a WeakTypeTag

    T

    type T

    returns

    ClassTag[T]

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def copy[T](instance: T, classLoader: ClassLoader = defaultClassLoader)(implicit arg0: ClassTag[T]): T

    Permalink

    Copy any instance using reflection.

    Copy any instance using reflection.

    Note: all the implicit type values must be explicitly mentioned in the ctor.

    So instead of implicitly passing the TypeTag: case class MyClass[T : TypeTag](t: T)

    Explicitly pass TypeTag as a val: case class MyClass[T](t: T)(implicit val tt: TypeTag[T])

    T

    type T

    instance

    instance of type T

    classLoader

    class loader to use

    returns

    a copy of t

    Exceptions thrown

    RuntimeException in case a ctor param value cannot be extracted

  10. def dealiasedTypeTagForType[T](rtm: Mirror = runtimeMirror())(implicit ttag: scala.reflect.api.JavaUniverse.TypeTag[T]): scala.reflect.api.JavaUniverse.TypeTag[T]

    Permalink

    Return a TypeTag of typeTag[T].tpe.dealias (see TypeApi.dealias)

    Return a TypeTag of typeTag[T].tpe.dealias (see TypeApi.dealias)

    T

    type T

    rtm

    runtime mirror

    ttag

    TypeTag[T]

    returns

    TypeTag of typeTag[T].tpe.dealias

  11. def dealisedTypeName(t: scala.reflect.api.JavaUniverse.Type): String

    Permalink

    Fully dealiased type name for Type.

    Fully dealiased type name for Type. This method performs a recursive dealising vs a regular type.dealias, which does on one level only.

    E.g: given a type of "Map[String,Double]" the result is "scala.collection.immutable.Map[java.lang.String,scala.Double]"

    t

    type to dealias

    returns

    fully dealised type name

  12. def defaultClassLoader: ClassLoader

    Permalink

    Default class loader - Thread.currentThread().getContextClassLoader

  13. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  19. def manifestForTypeTag[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Manifest[T]

    Permalink

    Creates a Manifest[T] of a TypeTag[T]

    Creates a Manifest[T] of a TypeTag[T]

    T

    type T with a TypeTag

    returns

    Manifest[T]

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

    Permalink
    Definition Classes
    AnyRef
  21. def newInstance[T](className: String, classLoader: ClassLoader): T

    Permalink

    Create a new of type T given it's class name

    Create a new of type T given it's class name

    T

    type T

    className

    instance class

    classLoader

    class loader to use

    returns

    new instance of T

  22. def newInstance[T](className: String): T

    Permalink

    Create a new of type T given it's class name

    Create a new of type T given it's class name

    T

    type T

    className

    instance class

    returns

    new instance of T

  23. def newInstance[T](klazz: Class[_], ctorArgs: (String, scala.reflect.api.JavaUniverse.Symbol) ⇒ Try[Any], classLoader: ClassLoader = defaultClassLoader): T

    Permalink

    Create a new instance of type T given a ctor args getter function

    Create a new instance of type T given a ctor args getter function

    klazz

    instance class

    ctorArgs

    ctor args getter function

    classLoader

    class loader to use

    returns

    new instance of T

  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. def reflectMethod[T](instance: T, methodName: String, argsCount: Option[Int] = None, classLoader: ClassLoader = defaultClassLoader)(implicit arg0: ClassTag[T]): scala.reflect.api.JavaUniverse.MethodMirror

    Permalink

    Find setter methods for the provided method name

    Find setter methods for the provided method name

    T

    type of instance to copy

    instance

    class to find method for

    methodName

    name of method to find

    argsCount

    optional number of arguments to match

    classLoader

    class loader to use

    returns

    reflected method to set type

  27. def reflectSetterMethod[T](instance: T, setterName: String, args: Seq[Any], argsCount: Option[Int] = None, classLoader: ClassLoader = defaultClassLoader)(implicit arg0: ClassTag[T]): Any

    Permalink

    Find setter methods for the provided method name

    Find setter methods for the provided method name

    T

    type of instance to copy

    instance

    class to find method for

    setterName

    name of method to find

    args

    argument values

    argsCount

    optional number of arguments to match

    classLoader

    class loader to use

    returns

    reflected method to set type

  28. def runtimeMirror(classLoader: ClassLoader = defaultClassLoader): Mirror

    Permalink

    Get a runtime mirror

    Get a runtime mirror

    classLoader

    class loader to use

    returns

    runtime mirror

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  31. def typeTagForType[T](tpe: scala.reflect.api.JavaUniverse.Type, rtm: Mirror = runtimeMirror()): scala.reflect.api.JavaUniverse.TypeTag[T]

    Permalink

    Create a TypeTag for Type

    Create a TypeTag for Type

    T

    type T

    tpe

    type

    rtm

    runtime mirror

    returns

    TypeTag[T]

  32. def typeTagForTypeName[T](typeName: String, rtm: Mirror = runtimeMirror()): scala.reflect.api.JavaUniverse.TypeTag[T]

    Permalink

    Returns a Type Tag by Type name

    Returns a Type Tag by Type name

    T

    type T

    typeName

    type name

    rtm

    runtime mirror

    returns

    TypeTag[T]

  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped