Package

sigma

reflection

Permalink

package reflection

Contains the Sigma Reflection API. Sigma reflection is a mechanism for obtaining metadata about classes, methods, fields, etc. at runtime. It is used by kiama to rewrite ErgoTree expressions. It is also used by the ErgoTree interpreter to implement MethodCall nodes.

The Sigma Reflection API has two implementations: 1) based on the Java Reflection API 2) based on Sigma Reflection metadata declared in the StaticImpl.scala file

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

Type Members

  1. class JRClass[T] extends RClass[T]

    Permalink

    A class that represents a Java class of type T.

  2. class JRConstructor[T] extends RConstructor[T]

    Permalink

    Implements RConstructor using Java reflection.

    Implements RConstructor using Java reflection.

    T

    The type of the class that declares this constructor.

  3. class JRField extends RField

    Permalink

    Implements RField using Java reflection.

  4. class JRMethod extends RMethod

    Permalink

    Implements RMethod using Java reflection.

  5. abstract class RClass[T] extends AnyRef

    Permalink

    Represents a class that can be reflected upon to obtain information about its fields, methods, constructors and superclass.

    Represents a class that can be reflected upon to obtain information about its fields, methods, constructors and superclass.

    T

    The type represented by this RClass.

  6. trait RConstructor[T] extends AnyRef

    Permalink

    A representation of a constructor of a class, providing reflective access to the constructor's parameters and ability to create new instances.

    A representation of a constructor of a class, providing reflective access to the constructor's parameters and ability to create new instances.

    T

    the type of the class

  7. abstract class RField extends AnyRef

    Permalink

    A representation of a field of a class, providing reflective access to the field's type.

  8. abstract class RMethod extends AnyRef

    Permalink

    Represents a method that can be invoked on an object with arguments.

  9. class SRClass[T] extends RClass[T]

    Permalink

    Represents a class in an Sigma Reflection metadata.

    Represents a class in an Sigma Reflection metadata. Extends RClass by providing a concrete implementation without relying on Java reflection.

  10. abstract class SRConstructor[T] extends RConstructor[T]

    Permalink

    Represents a constructor in an Sigma Reflection metadata.

    Represents a constructor in an Sigma Reflection metadata. Extends RConstructor by providing a concrete implementation without relying on Java reflection.

  11. class SRField extends RField

    Permalink

    Represents a field in an Sigma Reflection metadata.

    Represents a field in an Sigma Reflection metadata. Extends RField by providing a concrete implementation without relying on Java reflection. The instances of this class are used as parameters of registerClassEntry method.

  12. abstract class SRMethod extends RMethod

    Permalink

    Represents a method in an Sigma Reflection metadata.

    Represents a method in an Sigma Reflection metadata. Extends RMethod by providing a concrete implementation without relying on Java reflection.

Value Members

  1. object JRConstructor

    Permalink
  2. object JRField

    Permalink
  3. object JRMethod

    Permalink
  4. object Platform

    Permalink

    Platform dependent implementation of reflection methods.

  5. object RClass

    Permalink
  6. object ReflectionData

    Permalink

    Reflection metadata and global dictionaries to access it.

    Reflection metadata and global dictionaries to access it. For each class of this module that needs reflection metadata, we register a class entry with the necessary information. Only information that is needed at runtime is registered.

  7. def memoize[K, V](map: Map[K, V])(key: K, value: ⇒ V): V

    Permalink

    Memoizes a value in a mutable HashMap.

    Memoizes a value in a mutable HashMap.

    map

    The mutable HashMap to store the key-value pair.

    key

    The key to store in the map.

    value

    The value to be evaluated and stored in the map if the key is not present.

    returns

    The value associated with the given key in the map. If the key is not present in the map, evaluates the value parameter and stores it in the map before returning it.

  8. def mkConstructor(parameterTypes: Array[Class[_]])(handler: (Array[AnyRef]) ⇒ Any): SRConstructor[Any]

    Permalink

    Creates a new SRConstructor instance with the given parameter types and handler function.

    Creates a new SRConstructor instance with the given parameter types and handler function.

    parameterTypes

    the types of the constructor's parameters

    handler

    a function that handles creating a new instance using this constructor

    returns

    an SRConstructor instance

  9. def mkMethod(clazz: Class[_], name: String, paramTypes: Seq[Class[_]])(handler: (Any, Array[AnyRef]) ⇒ Any): ((String, Seq[Class[_]]), RMethod)

    Permalink

    Creates a new SRMethod instance with the given parameters and handler function.

    Creates a new SRMethod instance with the given parameters and handler function. This is analogous to the Java Reflection API's java.lang.reflect.Method class.

    clazz

    the java.lang.Class that declares the method

    name

    the name of the method

    paramTypes

    the types of the method's parameters

    handler

    a function that handles invoking the method, when RMethod.invoke is called then this handler is called

    returns

    a tuple containing the method's name and parameter types as its first element, and an SRMethod instance as its second element

    See also

    SRMethod

Inherited from AnyRef

Inherited from Any

Ungrouped