RuntimeApi
RuntimeApi is the main trait to implement in order to provide redaction functionalities for a specific Scala version, such as the type aliases and method utilities to parse Scala's AST for the specific major version of Scala.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait Scala3Runtime
- Self type
Members list
Type members
Types
The AST type of the method definition that will be patched.
The AST type of the method definition that will be patched.
Attributes
The AST type for a Literal, such as a character like "(" .
The AST type for a Literal, such as a character like "(" .
Attributes
The AST type for a position within a source file, useful for logging.
The AST type for a position within a source file, useful for logging.
Attributes
The AST type for a Symbol.
The AST type for a Symbol.
Attributes
The AST type for a TermName, such as methods like "toString" or ".$plus(..)" .
The AST type for a TermName, such as methods like "toString" or ".$plus(..)" .
Attributes
The AST type of the Tree that will be validated.
The AST type of the Tree that will be validated.
Attributes
Value members
Abstract methods
Given two Trees, combine them together using the String.+(..) operator, to concatenate them together
Given a tree
, it returns a List[Symbol] containing all the constructor's fields of the owner
Given a tree
, it returns a List[Symbol] containing all the constructor's fields of the owner
Attributes
- owner
the Symbol of the related
case class
- Returns:
the List[Symbol] of all the fields in the
owner
s' constructor
Given a Tree passed as parameter, this method tries to convert it (via pattern-match) into a DefDef if it
actually represents a toString
method.
Given a tree
, it returns the name of its owner (regardless whether it is a case class
or something else)
Given a tree
, it returns the name of its owner (regardless whether it is a case class
or something else)
Attributes
- tree
the Tree for which we would like to know its name
- Returns:
the String representation of the owner's name
Given the DefDef that represents the original toString
implementation, and the Tree that represents its
new body implementation, patch the new body into the existing definition, and return it.
Returns a list with all the Symbol(s) annotated with @redacted
from the given owner
Returns a list with all the Symbol(s) annotated with @redacted
from the given owner
Attributes
- owner
the Symbol representing a
case class
reference for which we want all its@redacted
fields- Returns:
a non-empty List[Symbol] with all the fields that are annotated with
@redacted
Given a Symbol that represents the owner
case class, and a Symbol that represents the constructor
field
inside it, it combines the two symbols in one Tree that is equivalent to selecting the field in the
case class.
Given a Symbol that represents the owner
case class, and a Symbol that represents the constructor
field
inside it, it combines the two symbols in one Tree that is equivalent to selecting the field in the
case class.
// class example
final case class User(id: Int, name: String, count: Int)
// can build some AST equivalent of
`User.this.id` or
`User.this.name` or
`User.this.count`
Attributes
- field
the Symbol that reference one specific field in the
owner
's constructor- owner
the Symbol that references the owning
case class
- Returns:
the Tree that select the
field
within theowner
Attributes
- Returns:
the TermName that is used to concatenate two Strings, i.e. "+" or ".$plus"
Concrete methods
Entry point of the redaction process: the tree
passed as parameter will be analysed and, if valid, it will be
patched and returned to the caller; otherwise, it will be returned unchanged.
Entry point of the redaction process: the tree
passed as parameter will be analysed and, if valid, it will be
patched and returned to the caller; otherwise, it will be returned unchanged.
Attributes
- tree
the tree that might get patched
- Returns:
the patched (or not) tree
Abstract fields
Concrete fields
the FQDN of @redacted
annotation
the FQDN of @redacted
annotation
Attributes
the name of toString
method
the name of toString
method