package si
- Source
- package.scala
Package Members
- package flowanalysis
Type Members
- trait Project extends AnyRef
- trait ProjectBasedAnalysis extends AnyRef
Common super trait of all analyses that use the fixpoint computations framework.
Common super trait of all analyses that use the fixpoint computations framework. In general, an analysis computes a org.opalj.fpcf.Property by processing some entities, e.g.: ´classes´, ´methods´ or ´fields´.
- trait ProjectInformationKey[-P <: Project, T <: AnyRef, I <: AnyRef] extends AnyRef
ProjectInformationKeyobjects are used to get/associate some (immutable) information with a project that should be computed on demand.ProjectInformationKeyobjects are used to get/associate some (immutable) information with a project that should be computed on demand. For example, imagine that you write an analysis that requires – as a foundation – the project's call graph. In this case, to get the call graph it is sufficient to pass the respective key to the Project object. If the call graph was already computed that one will be returned, otherwise the computation will be performed and the result will be cached for future usage before it is returned.Using Project Information
If access to some project information is required, it is sufficient to use the (singleton) instance of the respective
ProjectInformationKeyto get the respective project information.For example, let's assume that an index of all fields and methods is needed. In this case the code to get the index would be:
import ...{ProjectIndex,ProjectIndexKey} val project : Project = ??? val projectIndex = project.get(ProjectIndexKey) // do something with the index
Providing Project Information/Implementing
ProjectInformationKeyMaking project wide information available on demand is done as follows.
- Implement the base analysis that computes the information given some project.
- Implement your
ProjectInformationKeyclass that inherits from this trait and which calls the base analysis. It is recommended that the factory method (compute) is side-effect free.
Threading
Project takes care of threading related issues. The methods requirements and compute will never be called concurrently w.r.t. the same
projectobject. However, concurrent calls may happen w.r.t. two different project objects.Caching
Project takes care of the caching of the result of the computation of the information.
- T
The type of the information object that is derived.
- I
The type of information used at initialization time.
- type ProjectInformationKeys = Seq[ProjectInformationKey[_ <: Project, _ <: AnyRef, _ <: AnyRef]]