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 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 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).

  • FailAfterByteArrayOutputStream
  • JARsFileFilter
  • OpeningFileFailedException
  • package log
    Definition Classes
    opalj
  • package util

    Utility methods.

    Utility methods.

    Definition Classes
    opalj

package io

Various io-related helper methods and classes.

Note

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

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

Type Members

  1. class FailAfterByteArrayOutputStream extends ByteArrayOutputStream

    A java.io.ByteArrayOutputStream that throws an IOException after writing some bytes, if the given boundary (failAfter) is surpassed.

  2. case class OpeningFileFailedException(file: File, cause: Throwable) extends Exception with Product with Serializable

    Exception that is thrown if the OS cannot/does not know how/is not able to open the respective file.

Value Members

  1. def open(file: File): Unit
  2. def process[C <: Closeable, T](closable: C)(r: (C) => T): T

    This function takes a Closeable resource and a function r that will process the Closeable resource.

    This function takes a Closeable resource and a function r that will process the Closeable resource. This function takes care of the correct handling of Closeable resources. When r has finished processing the resource or throws an exception, the resource is closed.

    closable

    The Closeable resource.

    r

    The function that processes the resource.

    Note

    If closable is null, null is passed to r.

  3. def processSource[C <: Source, T](source: C)(r: (C) => T): T

    This function takes a Source object and a function r that will process the source.

    This function takes a Source object and a function r that will process the source. This function takes care of the correct handling of resources. When r has finished processing the source or throws an exception, the source is closed.

    Note

    If source is null, null is passed to r.

  4. def sanitizeFileName(fileName: String): String

    Replaces characters in the given file name (segment) that are (potentially) problematic on some file system and also shortens the filename

    Replaces characters in the given file name (segment) that are (potentially) problematic on some file system and also shortens the filename

    fileName

    The filename or a suffix/prefix thereof which should be sanitized.

    returns

    The sanitized file name.

    See also

    For more information visit https://en.wikipedia.org/wiki/Filename

  5. def write(data: IterableOnce[Array[Byte]], path: Path): Unit
  6. def write(data: Array[Byte], path: Path): Unit

    A simple wrapper for java.nio.Files.write(Path,byte[]).

  7. def write(data: IterableOnce[String], filenamePrefix: String, filenameSuffix: String): Path
  8. def write(data: String, filenamePrefix: String, filenameSuffix: String): Path
  9. def writeAndOpen(data: String, filenamePrefix: String, filenameSuffix: String): File

    Writes the given string (data) to a temporary file using the given prefix and suffix.

    Writes the given string (data) to a temporary file using the given prefix and suffix. Afterwards the system's native application that claims to be able to handle files with the given suffix is opened. If this fails, the string is printed to the console.

    The string is always written using UTF-8 as the encoding.

    filenamePrefix

    A string the identifies the content of the file. (E.g., "ClassHierarchy" or "CHACallGraph")

    filenameSuffix

    The suffix of the file that identifies the used file format. (E.g., ".txt")

    returns

    The name of the file if it was possible to write the file and open the native application.

    Annotations
    @throws("if it is not possible to create a temporary file") @throws("if it is not possible to open the file")
    Example:
    1. Exemplary usage:

      try {
          util.writeAndOpen("The Message", "Result", ".txt")
      } catch {
          case OpeningFileFailedException(file, _) =>
              Console.err.println("Details can be found in: "+file.toString)
  10. def writeAndOpen(node: Node, filenamePrefix: String, filenameSuffix: String): File

    Writes the XML document to a temporary file and opens the file in the OS's default application.

    Writes the XML document to a temporary file and opens the file in the OS's default application.

    filenamePrefix

    A string the identifies the content of the file. (E.g., "ClassHierarchy" or "CHACallGraph")

    filenameSuffix

    The suffix of the file that identifies the used file format. (E.g., ".xhtml")

    returns

    The name of the file if it was possible to write the file and open the native application.

    Annotations
    @throws("if it is not possible to create a temporary file") @throws("if it is not possible to open the file")
  11. def writeGZip(data: IterableOnce[Array[Byte]], path: Path): Unit
  12. def writeGZip(data: Array[Byte], path: Path): Unit
  13. def writeGZip(data: IterableOnce[String], filenamePrefix: String, filenameSuffix: String): Path
  14. def writeGZip(data: String, filenamePrefix: String, filenameSuffix: String): Path
  15. object JARsFileFilter extends FileFilter

Inherited from AnyRef

Inherited from Any

Ungrouped