Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package opalj

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode.

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode. OPAL is designed with performance, scalability and adaptability in mind.

    Its main components are:

    • a library (Common) which provides generally useful data-structures and algorithms for static analyses.
    • a framework for implementing lattice based static analyses (Static Analysis Infrastructure)
    • a framework for parsing Java bytecode (Bytecode Infrastructure) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a scalable, easily customizable framework for the abstract interpretation of Java bytecode (Abstract Interpretation Framework - org.opalj.ai).
    • a library to extract dependencies between code elements and to facilitate checking architecture definitions.
    • a library for the lightweight manipulation and creation of Java bytecode (Bytecode Assembler).

    General Design Decisions

    Thread Safety

    Unless explicitly noted, OPAL is thread safe. I.e., the classes defined by OPAL can be considered to be thread safe unless otherwise stated. (For example, it is possible to read and process class files concurrently without explicit synchronization on the client side.)

    No null Values

    Unless explicitly noted, OPAL does not null values I.e., fields that are accessible will never contain null values and methods will never return null. If a method accepts null as a value for a parameter or returns a null value it is always explicitly documented. In general, the behavior of methods that are passed null values is undefined unless explicitly documented.

    No Typecasts for Collections

    For efficiency reasons, OPAL sometimes uses mutable data-structures internally. After construction time, these data-structures are generally represented using their generic interfaces (e.g., scala.collection.{Set,Map}). However, a downcast (e.g., to add/remove elements) is always forbidden as it would effectively prevent thread-safety.

    Assertions

    OPAL makes heavy use of Scala's Assertion Facility to facilitate writing correct code. Hence, for production builds (after thorough testing(!)) it is highly recommend to build OPAL again using -Xdisable-assertions.

    Definition Classes
    org
  • package ai

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Please note that OPAL/the abstract interpreter just refers to the classes and traits defined in this package (ai). The classes and traits defined in the sub-packages (in particular in domain) are not considered to be part of the core of OPAL/the abstract interpreter.

    Definition Classes
    opalj
    Note

    This framework assumes that the analyzed bytecode is valid; i.e., the JVM's bytecode verifier would be able to verify the code. Furthermore, load-time errors (e.g., LinkageErrors) are – by default – completely ignored to facilitate the analysis of parts of a project. In general, if the presented bytecode is not valid, the result is undefined (i.e., OPAL may report meaningless results, crash or run indefinitely).

    See also

    org.opalj.ai.AI - Implements the abstract interpreter that processes a methods code and uses an analysis-specific domain to perform the abstract computations.

    org.opalj.ai.Domain - The core interface between the abstract interpretation framework and the abstract domain that is responsible for performing the abstract computations.

  • package av
    Definition Classes
    opalj
  • package ba

    Implementation of an eDSL for creating Java bytecode.

    Implementation of an eDSL for creating Java bytecode. The eDSL is designed to facilitate the creation of correct class files; i.e., whenever possible it tries to fill wholes. For example, when an interface is specified the library automatically ensures that the super class type is (initially) set to java.lang.Object as required by the JVM specification.

    This package in particular provides functionality to convert org.opalj.br classes to org.opalj.da classes.

    Definition Classes
    opalj
  • AccessModifier
  • AnnotatedInstructionElement
  • BRConstantsBuffer
  • CATCH
  • CLASS
  • CODE
  • CodeAttributeBuilder
  • CodeElement
  • EXCEPTIONS
  • ExceptionHandlerElement
  • ExceptionHandlerTableBuilder
  • FIELD
  • FIELDS
  • InsertionPosition
  • InstructionElement
  • InstructionLikeElement
  • LINENUMBER
  • LabelElement
  • LabeledCode
  • LineNumberTableBuilder
  • METHOD
  • METHODS
  • PCMapping
  • ProjectBasedInMemoryClassLoader
  • PseudoInstruction
  • TRY
  • TRYEND
  • ToDAConfig
  • package bc
    Definition Classes
    opalj
  • package bi

    Implementation of a library for parsing Java bytecode and creating arbitrary representations.

    Implementation of a library for parsing Java bytecode and creating arbitrary representations.

    OPAL's primary representation of Java byte code is the org.opalj.br representation which is defined in the respective package. A second representation that represents bytecode one-by-one is found in the org.opalj.da package.

    This Package

    Common constants and type definitions used across OPAL.

    Definition Classes
    opalj
  • package br

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries.

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries. This facilitates developing analyses and fosters comprehension.

    Based on the fact that indirect references to constant pool entries are resolved and replaced by direct references this representation is called the resolved representation.

    This representation of Java bytecode is considered as OPAL's standard representation for writing Scala based analyses. This representation is engineered such that it facilitates writing analyses that use pattern matching.

    Definition Classes
    opalj
  • package bytecode

    Defines functionality commonly useful when processing Java bytecode.

    Defines functionality commonly useful when processing Java bytecode.

    Definition Classes
    opalj
  • package collection

    OPAL's collection library is primarily designed with high performance in mind.

    Design Goals

    OPAL's collection library is primarily designed with high performance in mind. I.e., all methods provided by the collection library are reasonably optimized. However, providing a very large number of methods is a non-goal. Overall, OPAL's collection library provides:

    • collection classes that are manually specialized for primitive data-types.
    • collection classes that are optimized for particularly small collections of values.
    • collection classes that target special use cases such as using a collection as a workset/worklist.
    • collection classes that offer special methods that minimize the number of steps when compared to general purpose methods.

    Integration With Scala's Collection Library

    Hence, OPAL's collection library complements Scala's default collection library and is not intended to replace it. Integration with Scala's collection library is primarily provided by means of iterators (OPAL's Iterators inherit from Scala's Iterators). Furthermore the companion object of each of OPAL's collection classes generally provides factory methods that facilitate the conversion from Scala collection classes to OPAL collection classes.

    Status

    The collection library is growing. Nevertheless, the existing classes are production ready.

    Definition Classes
    opalj
  • package concurrent

    Common constants, factory methods and objects used throughout OPAL when performing concurrent computations.

    Common constants, factory methods and objects used throughout OPAL when performing concurrent computations.

    Definition Classes
    opalj
  • package constraints

    Defines helper values and methods related to modeling constraints.

    Defines helper values and methods related to modeling constraints.

    Definition Classes
    opalj
  • package control

    Defines common control abstractions.

    Defines common control abstractions.

    Definition Classes
    opalj
  • package da

    Defines convenience methods related to representing certain class file elements.

    Defines convenience methods related to representing certain class file elements.

    Definition Classes
    opalj
  • package de

    Functionality to extract dependencies between class files.

    Functionality to extract dependencies between class files.

    Definition Classes
    opalj
  • package fpcf

    The fixpoint computations framework (fpcf) is a general framework to perform fixpoint computations of properties ordered by a lattice.

    The fixpoint computations framework (fpcf) is a general framework to perform fixpoint computations of properties ordered by a lattice. The framework in particular supports the development of static analyses.

    In this case, the fixpoint computations/static analyses are generally operating on the code and need to be executed until the computations have reached their (implicit) fixpoint. The fixpoint framework explicitly supports resolving cyclic dependencies/computations. A prime use case of the fixpoint framework are all those analyses that may interact with the results of other analyses.

    For example, an analysis that analyzes all field write accesses to determine if we can refine a field's type (for the purpose of the analysis) can (reuse) the information about the return types of methods, which however may depend on the refined field types.

    The framework is generic enough to facilitate the implementation of anytime algorithms.

    Definition Classes
    opalj
    Note

    This framework assumes that all data-structures (e.g., dependee lists and properties) that are passed to the framework are effectively immutable! (Effectively immutable means that a data structure is never updated after it was passed to the framework.)

    ,

    The dependency relation is as follows: “A depends on B” === “A is the depender, B is the dependee”. === “B is depended on by A”

    ,

    The very core of the framework is described in: Lattice Based Modularization of Static Analyses

  • package graphs

    This package defines graph algorithms as well as factory methods to describe and compute graphs and trees.

    This package defines graph algorithms as well as factory methods to describe and compute graphs and trees.

    This package supports the following types of graphs:

    1. graphs based on explicitly connected nodes (org.opalj.graphs.Node),
    2. graphs where the relationship between the nodes are encoded externally (org.opalj.graphs.Graph).
    Definition Classes
    opalj
  • package io

    Various io-related helper methods and classes.

    Various io-related helper methods and classes.

    Definition Classes
    opalj
    Note

    The implementations of the methods rely on Java NIO(2).

  • package issues

    Defines implicit conversions to wrap some types of analyses such that they generate results of type org.opalj.br.analyses.ReportableAnalysisResult.

    Defines implicit conversions to wrap some types of analyses such that they generate results of type org.opalj.br.analyses.ReportableAnalysisResult.

    Definition Classes
    opalj
  • package log
    Definition Classes
    opalj
  • package tac

    Common definitions related to the definition and processing of three address code.

    Common definitions related to the definition and processing of three address code.

    Definition Classes
    opalj
  • package util

    Utility methods.

    Utility methods.

    Definition Classes
    opalj
  • package value

    Provides a general query interface for querying a value's properties.

    Provides a general query interface for querying a value's properties.

    Definition Classes
    opalj

package ba

Implementation of an eDSL for creating Java bytecode. The eDSL is designed to facilitate the creation of correct class files; i.e., whenever possible it tries to fill wholes. For example, when an interface is specified the library automatically ensures that the super class type is (initially) set to java.lang.Object as required by the JVM specification.

This package in particular provides functionality to convert org.opalj.br classes to org.opalj.da classes.

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ba
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class AccessModifier extends AnyVal

    Represents the access flags of a class (module), method or field declaration.

    Represents the access flags of a class (module), method or field declaration.

    All standard access flags are predefined.

    Example:
    1. To create a class file's, a field's or a method's access modifier, you can chain them using post fix notation, e.g.:

      PUBLIC FINAL

      or you just append the using '.', e.g.:

      PUBLIC.FINAL.SYNTHETIC.VARARGS
  2. case class AnnotatedInstructionElement[+T](instruction: LabeledInstruction, annotation: T) extends InstructionLikeElement[T] with Product with Serializable

    Wrapper for annotated org.opalj.br.instructions.LabeledInstructions.

  3. implicit final class BRConstantsBuffer extends AnyVal
  4. case class CATCH(id: Symbol, position: Int, handlerType: Option[ObjectType] = None) extends PseudoInstruction with ExceptionHandlerElement with Product with Serializable

    Pseudo instruction marking the handler of a org.opalj.br.ExceptionHandler.

    Pseudo instruction marking the handler of a org.opalj.br.ExceptionHandler.

    position

    The (relative) position in the final exception handler table. The CATCH with the lowest position will be the first exception handler (the handler with the highest priority). Overall the order is just used to sort the handlers and nothing more. The sorting is stable - i.e., two handlers with the same number will end up in the same order in the table. Furthermore, it is possible to use negative numbers to ensure that a (custom) handler has precedence over all handlers found in the initial code; the initial handlers will have ids in the range [0...(number of exception handler)).

    handlerType

    The type of the handled exception or None if all exceptions are handled (finally handler).

    See also

    ExceptionHandlerElement

  5. class CLASS[T] extends AnyRef

    Builder for org.opalj.br.ClassFile objects.

  6. class CodeAttributeBuilder[T] extends br.CodeAttributeBuilder[(Map[PC, T], List[String])]

    Builder for the org.opalj.br.Code attribute with all its properties.

    Builder for the org.opalj.br.Code attribute with all its properties. The Builder is created using the CODE factory.

    The max_stack and max_locals values will be calculated if not explicitly defined.

  7. trait CodeElement[+T] extends AnyRef

    Wrapper for elements that will generate the instructions and attributes of a org.opalj.br.Code and the annotations of the bytecode.

    Wrapper for elements that will generate the instructions and attributes of a org.opalj.br.Code and the annotations of the bytecode.

    T

    The type of the annotations of instructions.

    See also

    org.opalj.ba.InstructionElement

    org.opalj.ba.AnnotatedInstructionElement

    org.opalj.ba.PseudoInstruction

  8. case class EXCEPTIONS(exceptionTypes: String*) extends MethodAttributeBuilder with Product with Serializable

    Builder for the org.opalj.br.ExceptionTable attribute.

  9. trait ExceptionHandlerElement extends PseudoInstruction

    Pseudo instructions which generate the org.opalj.br.ExceptionHandler of the org.opalj.br.Code attribute.

    Pseudo instructions which generate the org.opalj.br.ExceptionHandler of the org.opalj.br.Code attribute. An ExceptionHandler is composed of the three pseudo instructions TRY, TRYEND and CATCH with the same identifier symbol. The exceptionHandler includes all instructions between TRY and TRYEND. The handlerPC is the pc of the instruction following the CATCH. If the label contains numbers at the end, the ExceptionHandlers are sorted ascending by that number in the ExceptionHandlerTable. Otherwise, the ExceptionHandlers are lexically sorted by their label.

  10. class ExceptionHandlerTableBuilder extends AnyRef

    Incrementally builds the org.opalj.br.ExceptionHandlers from the added pseudo instructions (ExceptionHandlerElement) representing an org.opalj.br.ExceptionHandler.

  11. case class FIELD(accessModifiers: AccessModifier, name: String, descriptor: String, attributesBuilders: ArraySeq[FieldAttributeBuilder] = ArraySeq.empty) extends Product with Serializable

    Builder for a org.opalj.br.Field; a FIELD object is intended to be stored in a org.opalj.ba.FIELDS collection.

  12. case class FIELDS(fields: FIELD*) extends Product with Serializable

    Builder for a sequence of org.opalj.br.Fields.

  13. case class InstructionElement(instruction: LabeledInstruction) extends InstructionLikeElement[Nothing] with Product with Serializable

    Wrapper for org.opalj.br.instructions.LabeledInstructions.

  14. sealed abstract class InstructionLikeElement[+T] extends CodeElement[T]

    Represents an (annotated) labeled instruction.

  15. case class LINENUMBER(lineNumber: Int) extends PseudoInstruction with Product with Serializable

    Pseudo instruction that generates an entry in the org.opalj.br.LineNumberTable with the program counter of the following instruction.

  16. case class LabelElement(label: InstructionLabel) extends PseudoInstruction with Product with Serializable

    Wrapper for InstructionLabels representing branch targets.

  17. class LabeledCode extends AnyRef

    Mutable container for some labeled code.

    Mutable container for some labeled code. We will use org.opalj.br.instructions.PCLabel labels for those labels which were created based on the original code. This enables the computation ofa mapping from old pcs to new pcs.

    Note

    Using LabeledCode is NOT thread safe.

  18. class LineNumberTableBuilder extends AnyRef

    Used to incrementally build the org.opalj.br.UnpackedLineNumberTable.

  19. class METHOD[T] extends AnyRef

    Builder for a org.opalj.br.MethodTemplate.

  20. case class METHODS[T](methods: ArraySeq[METHOD[T]]) extends Product with Serializable

    Builder for a list of org.opalj.br.MethodTemplates.

  21. class PCMapping extends (Int) => Int

    Mapping of some pc to some new pc.

    Mapping of some pc to some new pc. If no mapping exists, Int.MaxValue == PCMapping.Invalid is returned.

  22. class ProjectBasedInMemoryClassLoader extends ClassLoader

    A simple ClassLoader that looks-up the available classes from the given org.opalj.br.analyses.Project.

  23. abstract class PseudoInstruction extends CodeElement[Nothing]

    Marker trait for labels (scala.Symbol) and pseudo instructions generating Code attributes.

  24. case class TRY(id: Symbol) extends PseudoInstruction with ExceptionHandlerElement with Product with Serializable

    Pseudo instruction marking the start of a org.opalj.br.ExceptionHandler.

    Pseudo instruction marking the start of a org.opalj.br.ExceptionHandler.

    See also

    ExceptionHandlerElement

  25. case class TRYEND(id: Symbol) extends PseudoInstruction with ExceptionHandlerElement with Product with Serializable

    Pseudo instruction marking the end of a org.opalj.br.ExceptionHandler.

    Pseudo instruction marking the end of a org.opalj.br.ExceptionHandler.

    See also

    ExceptionHandlerElement

  26. case class ToDAConfig(retainOPALAttributes: Boolean = false, retainUnknownAttributes: Boolean = false) extends Product with Serializable

    Configures how specific kinds of attributes are handled during the serialization process.

Value Members

  1. final val ABSTRACT: AccessModifier
  2. final val ANNOTATION: AccessModifier
  3. final val BRIDGE: AccessModifier
  4. final val ENUM: AccessModifier
  5. final val FINAL: AccessModifier
  6. final val FrameworkName: String("OPAL Bytecode Assembler")
  7. final val INTERFACE: AccessModifier
  8. final val MANDATED: AccessModifier
  9. final val MODULE: AccessModifier
  10. final val NATIVE: AccessModifier
  11. final val OPEN: AccessModifier
  12. final val PRIVATE: AccessModifier
  13. final val PROTECTED: AccessModifier
  14. final val PUBLIC: AccessModifier
  15. final val STATIC: AccessModifier
  16. final val STATIC_PHASE: AccessModifier
  17. final val STRICT: AccessModifier
  18. final val SUPER: AccessModifier
  19. final val SYNCHRONIZED: AccessModifier
  20. final val SYNTHETIC: AccessModifier
  21. final val TRANSIENT: AccessModifier
  22. final val TRANSITIVE: AccessModifier
  23. final val VARARGS: AccessModifier
  24. final val VOLATILE: AccessModifier
  25. implicit def attributeToClassFileAttributeBuilder(a: Attribute): ClassFileAttributeBuilder
  26. implicit def attributeToFieldAttributeBuilder(a: Attribute): FieldAttributeBuilder
  27. implicit def attributeToMethodAttributeBuilder(a: Attribute): MethodAttributeBuilder
  28. implicit def codeAttributeBuilderToSome[T](b: br.CodeAttributeBuilder[T]): Some[br.CodeAttributeBuilder[T]]
  29. def createBoostrapMethodTableAttribute(constantsPool: ConstantsPool): Attribute
  30. implicit def methodAttributeBuilderToSeq(b: MethodAttributeBuilder): Seq[MethodAttributeBuilder]
  31. def toDA(constantPool: Array[Constant_Pool_Entry]): Array[Constant_Pool_Entry]
  32. def toDA(attribute: Attribute)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): Option[Attribute]

    Converts the given org.opalj.br.Attribute to a org.opalj.da.Attribute using the given configuration.

    Converts the given org.opalj.br.Attribute to a org.opalj.da.Attribute using the given configuration.

    See also

    org.opalj.br.Attribute#kindId for the list of all supported attributes.

  33. def toDA(typeAnnotation: TypeAnnotation)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): TypeAnnotation
  34. def toDA(typeAnnotationPath: TypeAnnotationPath): TypeAnnotationPath
  35. def toDA(typeAnnotationPathElement: TypeAnnotationPathElement): TypeAnnotationPathElement
  36. def toDA(typeAnnotationTarget: TypeAnnotationTarget): TypeAnnotationTarget
  37. def toDA(localvarTableEntry: LocalvarTableEntry): LocalvarTableEntry
  38. def toDA(annotation: Annotation)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): Annotation
  39. def toDA(elementValue: ElementValue)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): ElementValue
  40. def toDA(exceptionHandler: ExceptionHandler)(implicit constantsBuffer: ConstantsBuffer): ExceptionTableEntry
  41. def toDA(code: Code)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): Code_attribute
  42. def toDA(method: Method)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): Method_Info
  43. def toDA(field: Field)(implicit constantsBuffer: ConstantsBuffer, config: ToDAConfig): Field_Info
  44. def toDA(classFile: ClassFile)(implicit toDAConfig: ToDAConfig = ToDAConfig.RetainAllAttributes): ClassFile

    Converts a org.opalj.br.ClassFile to a org.opalj.da.ClassFile and all its attributes to the attributes in org.opalj.da.

  45. object AnnotatedInstructionElement extends Serializable
  46. object CATCH extends Serializable

    Factory methods to create an CATCH pseudo instruction.

  47. object CLASS
  48. object CODE

    Factory to create an initial CodeAttributeBuilder.

  49. object CodeAttributeBuilder
  50. object CodeElement

    Implicit conversions to CodeElement.

  51. object InsertionPosition extends Enumeration
  52. object InstructionLikeElement
  53. object LabeledCode
  54. object METHOD
  55. object METHODS extends Serializable
  56. object PCMapping
  57. object ToDAConfig extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped