class DependencyExtractor extends AnyRef
Traverses a org.opalj.br.SourceElement and identifies all dependencies between the element (org.opalj.br.ClassFile, org.opalj.br.Field or org.opalj.br.Method declaration) and any element it depends on. The kind of the dependencies that are extracted are defined by the DependencyType enumeration.
Concurrency
The DependencyExtractor
does not perform any kind of parallelization on its own.
Users of a DependencyExtractor
are expected to perform the parallelization (e.g.,
on the level of source elements) if desired.
Thread Safety
The DependencyExtractor
does not define any relevant state and, hence, this
class is thread-safe.
However, if multiple dependency extractors are executed concurrently and
share the same DependencyProcessor or the same DepencencyExtractor
is used by multiple threads concurrently, the DependencyProcessor has to be
thread-safe.
- Source
- DependencyExtractor.scala
- Note
By default, self dependencies will be reported (e.g., a method that calls itself, a class that defines a field with the same type). If necessary or undesired, self dependencies can easily be filtered by a DependencyProcessor's
,processDependency
method.If the DependencyExtractor is extended, it is important to delegate all creations of
VirtualSourceElements
to the DependencyProcessor to make sure that the dependency processor can perform, e.g., some internalization.
- Alphabetic
- By Inheritance
- DependencyExtractor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new DependencyExtractor(dependencyProcessor: DependencyProcessor)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- val dependencyProcessor: DependencyProcessor
- Attributes
- protected[this]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def process(declaringClass: VirtualClass, method: Method): Unit
Extracts all dependencies related to the given method.
Extracts all dependencies related to the given method.
- declaringClass
The method's declaring class.
- method
The method whose dependencies should be extracted.
- Attributes
- protected
- def process(declaringClass: VirtualClass, field: Field): Unit
Extracts all dependencies related to the given field.
Extracts all dependencies related to the given field.
- declaringClass
This field's declaring class.
- field
The field whose dependencies will be extracted.
- Attributes
- protected
- def process(classFile: ClassFile): Unit
Extracts all inter source element dependencies of the given class file (including all fields, methods, annotations,...
Extracts all inter source element dependencies of the given class file (including all fields, methods, annotations,... declared by it). I.e., it extracts all source code dependencies that start from the given class file, its fields or methods, respectively.
For each extracted dependency the respective dependencyProcessor is called.
- classFile
The class file whose dependencies should be extracted.
- def processDependency(source: VirtualSourceElement, target: Type, dType: DependencyType): Unit
- Attributes
- protected[this]
- def processDependency(source: VirtualSourceElement, target: ArrayType, dType: DependencyType): Unit
- Attributes
- protected[this]
- Annotations
- @inline()
- def processDependency(source: VirtualSourceElement, target: BaseType, dType: DependencyType): Unit
- Attributes
- protected[this]
- Annotations
- @inline()
- def processDependency(source: VirtualSourceElement, target: ObjectType, dType: DependencyType): Unit
- Attributes
- protected[this]
- Annotations
- @inline()
- def processDependency(source: ClassFile, target: ObjectType, dType: DependencyType): Unit
- Attributes
- protected[this]
- Annotations
- @inline()
- def processDependency(source: ClassFile, target: VirtualSourceElement, dType: DependencyType): Unit
- Attributes
- protected[this]
- def processDependency(source: ObjectType, target: VirtualSourceElement, dType: DependencyType): Unit
- Attributes
- protected[this]
- def processInvokedynamic(declaringMethod: VirtualMethod, instruction: INVOKEDYNAMIC): Unit
Prints a warning that the handling of org.opalj.br.instructions.INVOKEDYNAMIC instructions is incomplete (from the point of view of the dependencies to the "real" methods) and then calls processInvokedynamicRuntimeDependencies to handle the instruction.
Prints a warning that the handling of org.opalj.br.instructions.INVOKEDYNAMIC instructions is incomplete (from the point of view of the dependencies to the "real" methods) and then calls processInvokedynamicRuntimeDependencies to handle the instruction.
The warning is only shown once.
Overriding
This method should be overridden by subclasses that resolve dependencies related to an
Invokedynamic
instruction. However, in that case the method processInvokedynamicRuntimeDependencies should be called explicitly.- Attributes
- protected[this]
- def processInvokedynamicRuntimeDependencies(declaringMethod: VirtualMethod, instruction: INVOKEDYNAMIC): Unit
Default implementation for handling
Invokedynamic
instructions that only extracts dependencies on the runtime infrastructure (e.g., the bootstrap method and its surrounding class, the types of its arguments and its return type).Default implementation for handling
Invokedynamic
instructions that only extracts dependencies on the runtime infrastructure (e.g., the bootstrap method and its surrounding class, the types of its arguments and its return type).To gain more information about invokedynamic instructions, a special subclass of DependencyExtractor must be created which overrides this method and performs deeper-going analysis on invokedynamic instructions.
- Attributes
- protected[this]
- def processSignature(declaringElement: VirtualSourceElement, signature: SignatureElement, isInTypeParameters: Boolean = false): Unit
Processes the given signature.
Processes the given signature.
Processing a signature means extracting all references to types that are used in the type parameters that occur in the signature.
- declaringElement
The signature's element.
- signature
The signature whose type parameters should be analyzed.
- isInTypeParameters
true
if the current signature (part) is already a part of a type parameter.
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated