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. 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.
- Source
- package.scala
- Alphabetic
- By Inheritance
- br
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package analyses
Defines commonly useful type aliases.
- package cfg
- package collection
- package cp
Implementation of classes to represent/recreate a class file's constant pool.
- package fpcf
- package instructions
Common instruction sequences.
- package reader
Defines convenience methods related to reading in class files.
Type Members
- case class Annotation(annotationType: FieldType, elementValuePairs: ElementValuePairs = NoElementValuePairs) extends AnnotationLike with Product with Serializable
An annotation of a class, field, method or method parameter.
An annotation of a class, field, method or method parameter.
Annotations are associated with a class, field, or method using the attribute org.opalj.br.RuntimeInvisibleAnnotationTable or org.opalj.br.RuntimeVisibleAnnotationTable.
Annotations are associated with a method parameter using the attribute org.opalj.br.RuntimeInvisibleParameterAnnotationTable or a org.opalj.br.RuntimeVisibleParameterAnnotationTable.
- abstract class AnnotationLike extends AnyRef
An annotation of a code entity.
An annotation of a code entity.
Annotations are associated with a class, field, method, type etc. using the respective attributes.
- trait AnnotationTable extends Attribute
The runtime (in)visible annotations of a class, method, or field.
The runtime (in)visible annotations of a class, method, or field.
- Note
At the JVM level, repeating annotations (as supported by Java 8) (http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html) have no explicit support.
- case class AnnotationValue(annotation: Annotation) extends ElementValue with Product with Serializable
- type Annotations = ArraySeq[Annotation]
- final case class AppendFrame(frameType: Int, offsetDelta: Int, verificationTypeInfoLocals: VerificationTypeInfoLocals) extends StackMapFrame with Product with Serializable
- final class ArrayType extends ReferenceType
Represents an array type.
Represents an array type.
Comparing
ArrayType
sTo facilitate comparisons of (array) types, each array type is represented at any given time, by exactly one instance of
ArrayType
.General Information
From the JVM specification
An array type consists of a component type with a single dimension (whose length is not given by the type). The component type of an array type may itself be an array type. If, starting from any array type, one considers its component type, and then (if that is also an array type) the component type of that type, and so on, eventually one must reach a component type that is not an array type; this is called the element type of the array type. The element type of an array type is necessarily either a primitive type, or a class type, or an interface type.
- case class ArrayTypeSignature(typeSignature: TypeSignature) extends Signature with FieldTypeSignature with Product with Serializable
- See also
For matching signatures see Signature.
- case class ArrayValue(values: ElementValues) extends ElementValue with Product with Serializable
- trait Attribute extends AnyRef
A class file attribute.
A class file attribute.
Note
Some class file attributes are skipped or resolved while loading the class file and hence, are no longer represented at runtime.
- type Attributes = ArraySeq[Attribute]
- sealed trait BaseType extends FieldType with TypeSignature
- sealed trait BaseTypeElementValue extends ElementValue
Common super trait of all element values with a primitive base type.
- sealed abstract class BooleanType extends BaseType with CTIntType
The type of boolean values (true=1, false=0).
The type of boolean values (true=1, false=0).
Though the JVM internally uses an int value to store a boolean value the VM offers no special further support for handling booleans. In particular the conversion of some "byte|short|char|int" value to an int value is not directly supported.
- case class BooleanValue(value: Boolean) extends BaseTypeElementValue with Product with Serializable
- trait BootstrapArgument extends AnyRef
A marker trait to identify those constant pool values that can be arguments of boot strap methods.
- type BootstrapArguments = ArraySeq[BootstrapArgument]
- case class BootstrapMethod(handle: MethodHandle, arguments: BootstrapArguments) extends Product with Serializable
Java 7's 'BootstrapMethod'.
- case class BootstrapMethodTable(methods: BootstrapMethods) extends Attribute with Product with Serializable
Java 7's
BootstrapMethods_attribute
. - type BootstrapMethods = ArraySeq[BootstrapMethod]
- sealed abstract class ByteType extends IntLikeType
- case class ByteValue(value: Byte) extends BaseTypeElementValue with Product with Serializable
- sealed trait CTIntType extends Type
All values which are stored in a value with computational type integer.
- sealed abstract class CharType extends IntLikeType
- case class CharValue(value: Char) extends BaseTypeElementValue with Product with Serializable
- sealed trait ChopFrame extends StackMapFrame
- final case class ChopFrame248(offsetDelta: Int) extends StackMapFrame with ChopFrame with Product with Serializable
- final case class ChopFrame249(offsetDelta: Int) extends StackMapFrame with ChopFrame with Product with Serializable
- final case class ChopFrame250(offsetDelta: Int) extends StackMapFrame with ChopFrame with Product with Serializable
- final class ClassFile extends ConcreteSourceElement
Represents a single class file which either defines a class type or an interface type.
Represents a single class file which either defines a class type or an interface type. (
Annotation
types are also interface types andEnum
s are class types.)- Note
Equality of
ClassFile
objects is reference based and a class file's hash code is the same as the underlying ObjectType's hash code; i.e., 'thisType
's hash code.
- trait ClassFileAttributeBuilder extends AnyRef
Given a class files' main elements the attribute is build.
Given a class files' main elements the attribute is build.
- See also
The BytecodeAssember framework for an example usage.
- trait ClassFileRepository extends AnyRef
Enables the lookup of ClassFiles.
- class ClassHierarchy extends AnyRef
Represents a project's class hierarchy.
Represents a project's class hierarchy. The class hierarchy only contains information about those classes that were explicitly added to it. Hence, the class hierarchy may contain holes. However, the type
java.lang.Object
is always part of the class hierarchy.Thread safety
This class is effectively immutable; concurrent access to the class hierarchy is supported.
- Note
Java 9 module definitions are completely ignored.
,Unless explicitly documented, it is an error to pass an instance of
ObjectType
to any method if theObjectType
was not previously added. If in doubt, first check if the type is known (isKnown
/ifKnown
).
- trait ClassMember extends ConcreteSourceElement
Abstractions over the common properties of class members (Methods and Fields).
- case class ClassSignature(formalTypeParameters: List[FormalTypeParameter], superClassSignature: ClassTypeSignature, superInterfacesSignature: List[ClassTypeSignature]) extends Signature with Product with Serializable
- See also
For matching signatures see Signature.
- case class ClassTypeSignature(packageIdentifier: Option[String], simpleClassTypeSignature: SimpleClassTypeSignature, classTypeSignatureSuffix: List[SimpleClassTypeSignature]) extends Signature with FieldTypeSignature with ThrowsSignature with Product with Serializable
- See also
For matching signatures see Signature.
- case class ClassValue(value: Type) extends ElementValue with Product with Serializable
- type Classes = ArraySeq[ObjectType]
- final class Code extends Attribute with CommonAttributes with InstructionsContainer with CodeSequence[Instruction] with Iterable[PCAndInstruction]
Representation of a method's code attribute, that is, representation of a method's implementation.
- case class CodeAnalysisFailedException(message: String, code: Code, pc: PC) extends RuntimeException with Product with Serializable
Exception that is thrown when an analysis of a method's implementation has failed.
Exception that is thrown when an analysis of a method's implementation has failed.
- message
The message that describes the reason.
- code
The code block for which the analysis failed.
- pc
The program counter of the last instruction that was tried to analyze.
- trait CodeAttribute extends Attribute
Attributes which are referred to by the code attribute.
- trait CodeAttributeBuilder[T] extends AnyRef
Given a method's signature and access flags the code attribute is build and some meta information - depending on the type of the code attribute builder - is collected.
Given a method's signature and access flags the code attribute is build and some meta information - depending on the type of the code attribute builder - is collected.
- See also
The BytecodeAssember framework for an example usage.
- trait CodeSequence[Instruction <: AnyRef] extends AnyRef
A sequence of instructions; (currently) the common super trait of org.opalj.tac.TACStmts and org.opalj.br.Code)
A sequence of instructions; (currently) the common super trait of org.opalj.tac.TACStmts and org.opalj.br.Code)
- Instruction
The type of instructions.
- trait CommonAttributes extends AnyRef
Defines methods to return common attributes from the attributes table of ClassFile, Field, Method and Code declarations.
- trait CommonSourceElementAttributes extends CommonAttributes
Defines methods to return common attributes from the attributes table of ClassFile, Field and Method declarations.
- case class CompactLineNumberTable(rawLineNumbers: Array[Byte]) extends LineNumberTable with Product with Serializable
A method's line number table.
A method's line number table.
- rawLineNumbers
LineNumberTable_attribute { DATA: { u2 start_pc; u2 line_number; } }
The array must not be mutated by callers!
- class CompareAllConfiguration extends SimilarityTestConfiguration
- sealed abstract class ComputationalType extends AnyRef
The computational type of a value on the operand stack.
The computational type of a value on the operand stack.
(cf. JVM Spec. 2.11.1 Types and the Java Virtual Machine).
- sealed abstract class ComputationalTypeCategory extends AnyRef
The computational type category of a value on the operand stack.
The computational type category of a value on the operand stack.
(cf. JVM Spec. 2.11.1 Types and the Java Virtual Machine).
- trait ConcreteSourceElement extends SourceElement
We treat as a source element every entity that can be referred to by other class files.
- final case class ConstantClass(value: ReferenceType) extends ConstantValue[ReferenceType] with Product with Serializable
Represents a class or interface.
Represents a class or interface.
ConstantClass
is, e.g., used byanewarray
andmultianewarray
instructions. AConstantClass
value is never aField
value. I.e., it is never used to set the value of a static final field. - final case class ConstantDouble(value: Double) extends ConstantFieldValue[Double] with IsDoubleValue with Product with Serializable
- sealed abstract class ConstantFieldValue[T] extends Attribute with ConstantValue[T] with KnownTypedValue
A representation of the constant value of a field.
- final case class ConstantFloat(value: Float) extends ConstantFieldValue[Float] with IsFloatValue with Product with Serializable
- final case class ConstantInteger(value: Int) extends ConstantFieldValue[Int] with IsIntegerValue with Product with Serializable
- final case class ConstantLong(value: Long) extends ConstantFieldValue[Long] with IsLongValue with Product with Serializable
- final case class ConstantString(value: String) extends ConstantFieldValue[String] with IsStringValue with Product with Serializable
- trait ConstantValue[T] extends BootstrapArgument
Represents constant values; that is, values pushed onto the stack by the
ldc(2)(_w)
instructions or type information required by the instructions to create arrays.Represents constant values; that is, values pushed onto the stack by the
ldc(2)(_w)
instructions or type information required by the instructions to create arrays.- Note
A
MethodHandle
or MethodType (i.e., aMethodDescriptor
) is also aConstantValue
.
- sealed abstract class ContravariantIndicator extends VarianceIndicator
A declaration such as <? super Entry> is represented in class file signatures by the ContravariantIndicator ("? super") and a FieldTypeSignature.
A declaration such as <? super Entry> is represented in class file signatures by the ContravariantIndicator ("? super") and a FieldTypeSignature.
- See also
For matching signatures see Signature.
- sealed abstract class CovariantIndicator extends VarianceIndicator
If you have a declaration such as <? extends Entry> then the "? extends" part is represented by the
CovariantIndicator
.If you have a declaration such as <? extends Entry> then the "? extends" part is represented by the
CovariantIndicator
.- See also
For matching signatures see Signature.
- sealed abstract class DeclaredMethod extends AnyRef
Represents a declared method of a class identified by declaringClassType; that is, a method which belongs to the API of the class itself or a super class thereof.
- final class DefinedMethod extends DeclaredMethod
Represents a declared method; i.e., a method which belongs to the (public and private) API of a class along with a reference to the original declaration.
- sealed abstract class DoubleType extends NumericType
- case class DoubleValue(value: Double) extends BaseTypeElementValue with Product with Serializable
- final class DynamicConstant extends ConstantValue[Any]
Represents a dynamic constant.
Represents a dynamic constant.
DynamicConstant
is used to represent dynamic constant arguments of bootstrap methods. - sealed trait ElementValue extends Attribute
An element value represents an annotation's value or an annonation's default value; depending on the context in which it is used.
- case class ElementValuePair(name: String, value: ElementValue) extends Product with Serializable
An annotation's name-value pair.
- type ElementValuePairs = ArraySeq[ElementValuePair]
- type ElementValues = ArraySeq[ElementValue]
- case class EnclosingMethod(clazz: ObjectType, name: Option[String], descriptor: Option[MethodDescriptor]) extends Attribute with Product with Serializable
The optional enclosing method attribute of a class.
The optional enclosing method attribute of a class.
- name
The name of the enclosing method. The name is optional, but if defined, the descriptor also has to be defined.
- descriptor
The method descriptor of the enclosing method. The descriptor is optional, but if defined, the name also has to be defined.
- case class EnumValue(enumType: ObjectType, constName: String) extends ElementValue with Product with Serializable
- case class ExceptionHandler(startPC: Int, endPC: Int, handlerPC: Int, catchType: Option[ObjectType]) extends Product with Serializable
An entry in the exceptions table of a org.opalj.br.Code block.
An entry in the exceptions table of a org.opalj.br.Code block.
- startPC
A valid index into the code array. It points to the first instruction in the "try-block" (inclusive).
- endPC
An index into the code array that points to the instruction after the "try-block" (exclusive).
- handlerPC
Points to the first instruction of the exception handler.
- catchType
The type of the exception that is catched.
None
in case of a finally block.
- type ExceptionHandlers = ArraySeq[ExceptionHandler]
- case class ExceptionTable(exceptions: Exceptions) extends Attribute with Product with Serializable
Attribute in a method's attributes table that declares the (checked) exceptions that may be thrown by the method.
- type Exceptions = ArraySeq[ObjectType]
- case class Exports(exports: String, flags: Int, exportsTo: ArraySeq[String]) extends Product with Serializable
- exports
Name of an exported package in internal form.
- exportsTo
List of names of modules whose code can access the public types in this exported package (in internal form).
- final class Field extends JVMField
- sealed abstract class FieldAccessMethodHandle extends MethodHandle
- trait FieldAttributeBuilder extends AnyRef
Given a field's information a (final) attribute related to the field is build.
- case class FieldIdentifier(declaringObjectType: ObjectType, fieldName: String) extends StructureIdentifier with Product with Serializable
- sealed abstract class FieldReadAccessMethodHandle extends FieldAccessMethodHandle
- final class FieldTemplate extends JVMField
- type FieldTemplates = ArraySeq[FieldTemplate]
- sealed trait FieldType extends Type
Supertype of all types except VoidType.
- sealed trait FieldTypeSignature extends Signature with TypeSignature
- See also
For matching signatures see Signature.
- type FieldTypes = ArraySeq[FieldType]
- sealed abstract class FieldWriteAccessMethodHandle extends FieldAccessMethodHandle
- type Fields = ArraySeq[Field]
- sealed abstract class FloatType extends NumericType
- case class FloatValue(value: Float) extends BaseTypeElementValue with Product with Serializable
- case class FormalTypeParameter(identifier: String, classBound: Option[FieldTypeSignature], interfaceBound: List[FieldTypeSignature]) extends Product with Serializable
- See also
For matching signatures see Signature.
- final case class FullFrame(offsetDelta: Int, verificationTypeInfoLocals: VerificationTypeInfoLocals, verificationTypeInfoStack: VerificationTypeInfoStack) extends StackMapFrame with Product with Serializable
- case class GetFieldMethodHandle(declaringClassType: ObjectType, name: String, fieldType: FieldType) extends FieldReadAccessMethodHandle with Product with Serializable
- case class GetStaticMethodHandle(declaringClassType: ObjectType, name: String, fieldType: FieldType) extends FieldReadAccessMethodHandle with Product with Serializable
- case class InnerClass(innerClassType: ObjectType, outerClassType: Option[ObjectType], innerName: Option[String], innerClassAccessFlags: Int) extends Product with Serializable
- case class InnerClassTable(innerClasses: InnerClasses) extends Attribute with Product with Serializable
Attribute in a class' attribute table that encodes information about inner classes.
- type InnerClasses = ArraySeq[InnerClass]
- type InstructionLabels = ArraySeq[InstructionLabel]
- type Instructions = Array[Instruction]
- trait InstructionsContainer extends AnyRef
Common interface of all elements that have (at most one) sequence of instructions.
- sealed abstract class IntLikeType extends NumericType with CTIntType
An IntLikeType is every type (byte, char, short and int) that uses a primitive int to store the current value and which has explicit support in the JVM.
An IntLikeType is every type (byte, char, short and int) that uses a primitive int to store the current value and which has explicit support in the JVM.
- Note
Boolean
values are (at least conceptually) also stored in ints. However, the JVM has basically no explicit support for booleans (e.g., a conversion of an int value to a boolean is not directly supported).
- case class IntValue(value: Int) extends BaseTypeElementValue with Product with Serializable
- sealed abstract class IntegerType extends IntLikeType
- type Interfaces = ArraySeq[ObjectType]
- case class InvokeInterfaceMethodHandle(receiverType: ReferenceType, name: String, methodDescriptor: MethodDescriptor) extends MethodCallMethodHandle with Product with Serializable
- case class InvokeSpecialMethodHandle(receiverType: ReferenceType, isInterface: Boolean, name: String, methodDescriptor: MethodDescriptor) extends MethodCallMethodHandle with Product with Serializable
- case class InvokeStaticMethodHandle(receiverType: ReferenceType, isInterface: Boolean, name: String, methodDescriptor: MethodDescriptor) extends MethodCallMethodHandle with Product with Serializable
- case class InvokeVirtualMethodHandle(receiverType: ReferenceType, name: String, methodDescriptor: MethodDescriptor) extends MethodCallMethodHandle with Product with Serializable
- sealed abstract class JVMField extends ClassMember with Ordered[JVMField]
Represents a single field declaration/definition.
Represents a single field declaration/definition.
- sealed abstract class JVMMethod extends ClassMember with Ordered[JVMMethod] with InstructionsContainer
Represents a single method.
Represents a single method.
Method objects are constructed using the companion object's factory methods.
- Note
Methods, which are directly created, have no link to "their defining" ClassFile. This link is implicitly established when a method is added to a ClassFile. This operation also updates the method object. Hence, an empty method/constructor which is identical across multiple classes can be reused.
,Equality of methods is – by purpose – reference based.
- case class LineNumber(startPC: PC, lineNumber: Int) extends Product with Serializable
An entry in a line number table.
- trait LineNumberTable extends CodeAttribute
A method's line number table.
- type LineNumbers = ArraySeq[LineNumber]
- type LiveVariables = Array[BitArraySet]
- case class LocalVariable(startPC: PC, length: Int, name: String, fieldType: FieldType, index: Int) extends Product with Serializable
An entry in a local variable table.
- case class LocalVariableTable(localVariables: LocalVariables) extends CodeAttribute with Product with Serializable
Representation of the local variable table.
- case class LocalVariableType(startPC: PC, length: Int, name: String, signature: FieldTypeSignature, index: Int) extends Product with Serializable
- case class LocalVariableTypeTable(localVariableTypes: LocalVariableTypes) extends CodeAttribute with Product with Serializable
Representation of the local variable type table.
- type LocalVariableTypes = ArraySeq[LocalVariableType]
- type LocalVariables = ArraySeq[LocalVariable]
- case class LocalvarTableEntry(startPC: Int, length: Int, index: Int) extends Product with Serializable
The local variable is valid in the range
[start_pc, start_pc + length)
. - sealed abstract class LongType extends NumericType
- case class LongValue(value: Long) extends BaseTypeElementValue with Product with Serializable
- final class Method extends JVMMethod
A method belonging to a class file.
A method belonging to a class file. Method objects are created by creating a class file using MethodTemplates.
- trait MethodAttributeBuilder extends AnyRef
Given a method's signature and access flags the attribute related to the method is build.
Given a method's signature and access flags the attribute related to the method is build.
- See also
The BytecodeAssember framework for an example usage.
- sealed abstract class MethodCallMethodHandle extends MethodHandle
- sealed abstract class MethodDescriptor extends ConstantValue[MethodDescriptor] with (Int) => FieldType with Ordered[MethodDescriptor]
A method descriptor represents the parameters that the method takes and the value that it returns.
A method descriptor represents the parameters that the method takes and the value that it returns.
- Note
The
equals(Any):Boolean
method takes the number of parameters and types into account. I.e., two method descriptor objects are equal if they have the same number of parameters and each parameter has the same Type.
- type MethodDescriptors = ArraySeq[MethodDescriptor]
- sealed abstract class MethodHandle extends ConstantValue[MethodHandle]
A method handle.
- case class MethodIdentifier(declaringReferenceType: ReferenceType, methodName: String, methodDescriptor: MethodDescriptor) extends StructureIdentifier with Product with Serializable
- case class MethodParameter(name: Option[String], accessFlags: Int) extends Product with Serializable
The description of a method parameter.
The description of a method parameter. If
name
isNone
a formal parameter is described. - case class MethodParameterTable(parameters: MethodParameters) extends (Int) => MethodParameter with Attribute with Product with Serializable
Representation of a method's information about the method parameters.
- type MethodParameters = ArraySeq[MethodParameter]
- final case class MethodSignature(name: String, descriptor: MethodDescriptor) extends Product with Serializable
Represents a method signature which consists of the name and descriptor of a method; the signatures of all methods of a class file have to be different.
- final class MethodTemplate extends JVMMethod
A method which is not (yet) associated with a class file.
- type MethodTemplates = ArraySeq[MethodTemplate]
- case class MethodTypeSignature(formalTypeParameters: List[FormalTypeParameter], parametersTypeSignatures: List[TypeSignature], returnTypeSignature: ReturnTypeSignature, throwsSignature: List[ThrowsSignature]) extends Signature with Product with Serializable
- See also
For matching signatures see Signature.
- type Methods = ArraySeq[Method]
- case class Module(name: String, moduleFlags: Int, versionInfo: Option[String], requires: ArraySeq[Requires], exports: ArraySeq[Exports], opens: ArraySeq[Opens], uses: ArraySeq[ObjectType], provides: ArraySeq[Provides]) extends Attribute with Product with Serializable
Definition of a Java 9 module.
- case class ModuleMainClass(mainClassType: ObjectType) extends Attribute with Product with Serializable
Definition of a Java 9 module main class.
- case class ModulePackages(packages: Packages) extends Attribute with Product with Serializable
Definition of a Java 9 module's packages.
- final class MultipleDefinedMethods extends DeclaredMethod
- case class NestHost(hostClassType: ObjectType) extends Attribute with Product with Serializable
Definition of a Java 11 nest host.
- case class NestMembers(classes: Classes) extends Attribute with Product with Serializable
Definition of Java 11 nest members.
- case class NewInvokeSpecialMethodHandle(receiverType: ObjectType, methodDescriptor: MethodDescriptor) extends MethodCallMethodHandle with Product with Serializable
- trait NoSourceElementsVisitor extends SourceElementsVisitor[Unit]
Simple implementation of the SourceElementsVisitor trait where all methods do nothing.
- sealed abstract class NumericType extends BaseType
- final class ObjectType extends ReferenceType
Represents an
ObjectType
. - type ObjectTypes = ArraySeq[ObjectType]
- case class ObjectVariableInfo(clazz: ReferenceType) extends VerificationTypeInfo with Product with Serializable
- final type Opcode = Int
- case class Opens(opens: String, flags: Int, toPackages: ArraySeq[String]) extends Product with Serializable
- opens
The name of the package.
- final type PC = Int
A program counter identifies an instruction in a code array.
A program counter identifies an instruction in a code array.
A program counter is a value in the range
[0/*UShort.min*/, 65535/*UShort.max*/]
.- Note
This type alias serves comprehension purposes.
- final class PCAndAnyRef[T <: AnyRef] extends AnyRef
An efficient (i.e., no (un)boxing...) representation of an instruction and a value.
- final class PCAndInstruction extends AnyRef
An efficient (i.e., no (un)boxing...) representation of an instruction and its pc.
- final class PCInMethod extends AnyRef
An efficient (i.e., no (un)boxing...) representation of an instruction (identified) by its pc in a method.
- final type PCs = IntTrieSet
A collection of program counters using an IntArraySet as its backing collection.
A collection of program counters using an IntArraySet as its backing collection.
Using PCs is in particular well suited for small(er) collections.
- Note
This type alias serves comprehension purposes.
- type Packages = ArraySeq[String]
- trait ParameterAnnotationTable extends Attribute
Parameter annotations.
- type ParameterAnnotations = ArraySeq[Annotations]
- case class PermittedSubclasses(classes: Classes) extends Attribute with Product with Serializable
Definition of Java 17 permitted subclasses of a sealed class.
- case class ProperTypeArgument(varianceIndicator: Option[VarianceIndicator], fieldTypeSignature: FieldTypeSignature) extends TypeArgument with Product with Serializable
- See also
For matching signatures see Signature.
- case class Provides(provides: ObjectType, withInterfaces: ArraySeq[ObjectType]) extends Product with Serializable
- case class PutFieldMethodHandle(declaringClassType: ObjectType, name: String, fieldType: FieldType) extends FieldWriteAccessMethodHandle with Product with Serializable
- case class PutStaticMethodHandle(declaringClassType: ObjectType, name: String, fieldType: FieldType) extends FieldWriteAccessMethodHandle with Product with Serializable
- case class Record(components: RecordComponents) extends Attribute with (Int) => RecordComponent with Product with Serializable
Representation of a record class.
- case class RecordComponent(name: String, componentType: FieldType, attributes: Attributes) extends Product with Serializable
The description of a record component (Java 16).
- type RecordComponents = ArraySeq[RecordComponent]
- sealed abstract class ReferenceType extends FieldType
- case class Requires(requires: String, flags: Int, version: Option[String]) extends Product with Serializable
- requires
The name of a required module.
- trait ReturnTypeSignature extends SignatureElement
- case class RuntimeInvisibleAnnotationTable(annotations: Annotations) extends AnnotationTable with Product with Serializable
The runtime invisible class, method, or field annotations.
- case class RuntimeInvisibleParameterAnnotationTable(parameterAnnotations: ParameterAnnotations) extends ParameterAnnotationTable with Product with Serializable
Parameter annotations.
- case class RuntimeInvisibleTypeAnnotationTable(typeAnnotations: TypeAnnotations) extends TypeAnnotationTable with Product with Serializable
The runtime invisible type annotations.
- case class RuntimeVisibleAnnotationTable(annotations: Annotations) extends AnnotationTable with Product with Serializable
A class, method, or field annotation.
- case class RuntimeVisibleParameterAnnotationTable(parameterAnnotations: ParameterAnnotations) extends ParameterAnnotationTable with Product with Serializable
Parameter annotations.
- case class RuntimeVisibleTypeAnnotationTable(typeAnnotations: TypeAnnotations) extends TypeAnnotationTable with Product with Serializable
A runtime visible type annotation.
- final case class SameFrame(frameType: Int) extends StackMapFrame with Product with Serializable
- final case class SameFrameExtended(offsetDelta: Int) extends StackMapFrame with Product with Serializable
- final case class SameLocals1StackItemFrame(frameType: Int, verificationTypeInfoStackItem: br.VerificationTypeInfo) extends StackMapFrame with Product with Serializable
- final case class SameLocals1StackItemFrameExtended(offsetDelta: Int, verificationTypeInfoStackItem: br.VerificationTypeInfo) extends StackMapFrame with Product with Serializable
- sealed abstract class ShortType extends IntLikeType
- case class ShortValue(value: Short) extends BaseTypeElementValue with Product with Serializable
- sealed abstract class Signature extends SignatureElement with Attribute
An attribute-level signature as defined in the JVM specification.
An attribute-level signature as defined in the JVM specification.
To match
Signature
objects the predefined matchers/extractors can be used. * @exampleExample 1
interface Processor extends Function<Object, Void> { /*empty*/ }
ClassSignature:
Ljava/lang/Object;Ljava/util/function/Function<Ljava/lang/Object;Ljava/lang/Void;>;
ClassSignature( typeParameters=List(), superClass=ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Object,List()),List()), superInterfaces=List( ClassTypeSignature( Some(java/util/function/), SimpleClassTypeSignature(Function, List(ProperTypeArgument( None, ClassTypeSignature( Some(java/lang/), SimpleClassTypeSignature(Object,List()), List())), ProperTypeArgument( None, ClassTypeSignature( Some(java/lang/), SimpleClassTypeSignature(Void,List()), List())))), List())))
Example 2
interface Col<C> { /*empty*/ }
ClassSignature:
<C:Ljava/lang/Object;>Ljava/lang/Object;
ClassSignature( typeParameters= List( FormalTypeParameter( C, Some(ClassTypeSignature( Some(java/lang/),SimpleClassTypeSignature(Object,List()),List())), List())), superClass=ClassTypeSignature( Some(java/lang/),SimpleClassTypeSignature(Object,List()),List()), superInterfaces=List())
Example 3
interface ColObject extends Col<Object> { /*empty*/ }
ClassSignature:
Ljava/lang/Object;LCol<Ljava/lang/Object;>;
ClassSignature( typeParameters=List(), superClass=ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Object,List()),List()), superInterfaces=List( ClassTypeSignature( None, SimpleClassTypeSignature( Col, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Object,List()),List())) )), List())))
Example 4
interface ColError<E extends Error> extends Col<E>{/*empty*/}
ClassSignature:
<E:Ljava/lang/Error;>Ljava/lang/Object;LCol<TE;>;
ClassSignature( typeParameters=List( FormalTypeParameter( E, Some(ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Error,List()),List())),List())), superClass=ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Object,List()),List()), superInterfaces=List( ClassTypeSignature( None, SimpleClassTypeSignature( Col, List(ProperTypeArgument(variance=None,signature=TypeVariableSignature(E)))), List())))
Example 5
class Use { // The following fields all have "ClassTypeSignatures" Col<?> ce = null; // Signature: LCol<*>; Col<Object> co = null; // Signature: LCol<Ljava/lang/Object;>; Col<? super Serializable> cs = null; // Signature: LCol<-Ljava/io/Serializable;>; Col<? extends Comparable<?>> cc = null; // Signature: LCol<+Ljava/lang/Comparable<*>;>; MyCol<java.util.List<Object>> mco = new MyCol<>(); MyCol<java.util.List<Object>>.MyInnerCol<Comparable<java.util.List<Object>>> mico = this.mco.new MyInnerCol<Comparable<java.util.List<Object>>>(); // Signature: LMyCol<Ljava/util/List<Ljava/lang/Object;>;>.MyInnerCol<Ljava/lang/Comparable<Ljava/util/List<Ljava/lang/Object;>;>;>; }
AST of
mico
:ClassSignature( typeParameters=List(), superClass=ClassTypeSignature( None, SimpleClassTypeSignature( MyCol, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature( Some(java/util/), SimpleClassTypeSignature( List, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature( Some(java/lang/), SimpleClassTypeSignature(Object,List()), List())))), List())))), /*suffic=*/List(SimpleClassTypeSignature( MyInnerCol, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature( Some(java/lang/), SimpleClassTypeSignature( Comparable, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature( Some(java/util/), SimpleClassTypeSignature( List, List(ProperTypeArgument( variance=None, signature=ClassTypeSignature( Some(java/lang/), SimpleClassTypeSignature(Object,List()), List())))), List())))), List())))))), superInterfaces=List())
Matching Signatures
Scala REPL:
val SignatureParser = org.opalj.br.reader.SignatureParser val GenericType = org.opalj.br.GenericType val SimpleGenericType = org.opalj.br.SimpleGenericType val BasicClassTypeSignature = org.opalj.br.BasicClassTypeSignature SignatureParser.parseClassSignature("<E:Ljava/lang/Error;>Ljava/lang/Object;LCol<TE;>;").superInterfacesSignature.head match { case BasicClassTypeSignature(ot) => ot.toJava; case _ => null} // res: String = Col SignatureParser.parseClassSignature("<E:Ljava/lang/Error;>Ljava/lang/Object;LCol<TE;>;").superInterfacesSignature.head match { case SimpleGenericType(bt,gt) => bt.toJava+"<"+gt.toJava+">"; case _ => null} //res11: String = null scala> SignatureParser.parseFieldTypeSignature("LCol<Ljava/lang/Object;>;") match { case SimpleGenericType(bt,ta) => bt.toJava+"<"+ta+">"; case _ => null} res1: String = Col<ObjectType(java/lang/Object)> scala> SignatureParser.parseFieldTypeSignature("LCol<Ljava/lang/Object;>;") match { case GenericType(bt,ta) => bt.toJava+"<"+ta+">"; case _ => null} res2: String = Col<List(ProperTypeArgument(variance=None,signature=ClassTypeSignature(Some(java/lang/),SimpleClassTypeSignature(Object,List()),List())))>
- trait SignatureElement extends AnyRef
An element of a Signature used to encode generic type information.
- trait SignatureVisitor[T] extends AnyRef
Implements a visitor for type signatures.
- abstract class SimilarityTestConfiguration extends AnyRef
Specifies which parts of a class file should be compared with another one.
- case class SimpleClassTypeSignature(simpleName: String, typeArguments: List[TypeArgument]) extends Product with Serializable
- See also
For matching signatures see Signature.
- case class SourceDebugExtension(debug_extension: Array[Byte]) extends Attribute with Product with Serializable
Attribute to associate additional debug information with a class.
Attribute to associate additional debug information with a class. The source debug extension attribute is an optional attribute of a class declaration (org.opalj.br.ClassFile).
- trait SourceElement extends CommonSourceElementAttributes
We treat as a source element every entity that can be referred to by other class files.
- final type SourceElementID = Int
- trait SourceElementsVisitor[T] extends AnyRef
Classes that traverse a class file can extend this trait to facilitate reporting the traversed source file elements.
- case class SourceFile(sourceFile: String) extends Attribute with Product with Serializable
The source file attribute is an optional attribute in the attributes table of org.opalj.br.ClassFile objects.
The source file attribute is an optional attribute in the attributes table of org.opalj.br.ClassFile objects.
- sourceFile
The name of the source file from which this class file was compiled; it will not contain any path information.
- sealed abstract class StackMapFrame extends AnyRef
Part of the Java 6 stack map table attribute.
- type StackMapFrames = ArraySeq[StackMapFrame]
- case class StackMapTable(stackMapFrames: StackMapFrames) extends Attribute with Product with Serializable
Java 6's stack map table attribute.
- case class StringValue(value: String) extends ElementValue with Product with Serializable
- trait StructureIdentifier extends AnyRef
Uniquely identifies a specific element that can (by definition) only exist once in a project.
Uniquely identifies a specific element that can (by definition) only exist once in a project. For example, in the context of OPAL a type declaration is unique or the combination of a type declaration and a field name or the combination of a type declaration, method name and method descriptor.
- sealed abstract class SubtypeInformation extends TypeHierarchyInformation
Represents a type's subtype information.
- sealed abstract class SupertypeInformation extends TypeHierarchyInformation
Represents a type's supertype information.
- case class SynthesizedClassFiles(classFiles: List[(ClassFile, Option[AnyRef])]) extends Attribute with Product with Serializable
This attribute stores references to ClassFile objects that have been generated while parsing the annotated ClassFile.
This attribute stores references to ClassFile objects that have been generated while parsing the annotated ClassFile.
For example, to represent proxy types that have been created by Java8 lambda or method reference expressions.
This attribute may only be present while the class file is processed/read and will be removed from the attributes table before any analysis sees the "final" class file.
This attribute may occur multiple times in the attributes table of a class file structure.
- classFiles
A sequence consisting of class file objects and "reasons" why the respective class file was created.
- case class TAOfCastExpression(offset: Int, type_argument_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfCatch(exception_table_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfConstructorInMethodReferenceExpression(offset: Int, type_argument_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfConstructorInvocation(offset: Int, type_argument_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfFormalParameter(formal_parameter_index: Int) extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case class TAOfInstanceOf(offset: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfLocalvarDecl(localVarTable: ArraySeq[LocalvarTableEntry]) extends TypeAnnotationTargetInVarDecl with Product with Serializable
- case class TAOfMethodInMethodReferenceExpression(offset: Int, type_argument_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfMethodInvocation(offset: Int, type_argument_index: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfMethodReferenceExpressionIdentifier(offset: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfMethodReferenceExpressionNew(offset: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfNew(offset: Int) extends TypeAnnotationTargetInCode with Product with Serializable
- case class TAOfParameterDeclarationOfClassOrInterface(type_parameter_index: Int) extends TypeAnnotationTargetInClassDeclaration with Product with Serializable
- case class TAOfParameterDeclarationOfMethodOrConstructor(type_parameter_index: Int) extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case class TAOfResourcevarDecl(localVarTable: ArraySeq[LocalvarTableEntry]) extends TypeAnnotationTargetInVarDecl with Product with Serializable
- case class TAOfSupertype(supertype_index: Int) extends TypeAnnotationTargetInClassDeclaration with Product with Serializable
- case class TAOfThrows(throws_type_index: Int) extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case class TAOfTypeBoundOfParameterDeclarationOfClassOrInterface(type_parameter_index: Int, bound_index: Int) extends TypeAnnotationTargetInClassDeclaration with Product with Serializable
- case class TAOfTypeBoundOfParameterDeclarationOfMethodOrConstructor(type_parameter_index: Int, bound_index: Int) extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case class TAOnNestedType(path: ArraySeq[TypeAnnotationPathElement]) extends TypeAnnotationPath with Product with Serializable
- case class TAOnTypeArgument(index: Int) extends TypeAnnotationPathElement with Product with Serializable
- sealed trait ThrowsSignature extends SignatureElement
- trait TraversingVisitor extends SignatureVisitor[Unit]
This visitor's
visit
methods completely traverse all elements of a type signature. - sealed trait Type extends UIDValue with Ordered[Type]
Represents a JVM type.
Represents a JVM type.
Programmatically, we distinguish three major kinds of types:
- base types/primitive types,
- reference types,
- the type void.
General Information
From the JVM specification
There are three kinds of reference types: class types, array types, and interface types. Their values are references to dynamically created class instances, arrays, or class instances or arrays that implement interfaces, respectively.
A reference value may also be the special null reference, a reference to no object, which will be denoted here by null. The null reference initially has no runtime type, but may be cast to any type. The default value of a reference type is null. The Java virtual machine specification does not mandate a concrete value encoding null.
Comparing Types/Performance
Given that the comparison of types is a standard operation in static analysis that is usually done over and over again great care was taken to enable an efficient comparison of types. It is - without exception - always possible to compare types using reference equality (i.e., the
eq
/ne
operators). For each type there will always be at most one object that represents that specific type.Additionally, a stable order is defined between types that is based on a type's kind and the unique id of the types in case of reference types. The order is: void type < primitive types < array types < class/interface types
- case class TypeAnnotation(target: TypeAnnotationTarget, path: TypeAnnotationPath, annotationType: FieldType, elementValuePairs: ElementValuePairs) extends AnnotationLike with Product with Serializable
A type annotation (*TA*).
A type annotation (*TA*).
TypeAnnotations were introduced with Java 8 and are associated with a ClassFile, Field, Method or Code using a org.opalj.br.RuntimeInvisibleTypeAnnotationTable or a org.opalj.br.RuntimeVisibleTypeAnnotationTable attribute.
- sealed abstract class TypeAnnotationPath extends AnyRef
The path that describes which type is actually annotated using a TypeAnnotation.
- sealed abstract class TypeAnnotationPathElement extends AnyRef
An element of the path that describes which type is actually annotated using a TypeAnnotation.
- trait TypeAnnotationTable extends CodeAttribute
The runtime (in)visible type annotations of a class, method, field or code block.
The runtime (in)visible type annotations of a class, method, field or code block.
- Note
For further information about type-level annotations go to: http://cr.openjdk.java.net/~abuckley/8misc.pdf.
- sealed abstract class TypeAnnotationTarget extends AnyRef
Describes the kind of the target of a TypeAnnotation.
- sealed abstract class TypeAnnotationTargetInClassDeclaration extends TypeAnnotationTarget
- sealed abstract class TypeAnnotationTargetInCode extends TypeAnnotationTarget
- sealed abstract class TypeAnnotationTargetInFieldDeclaration extends TypeAnnotationTarget
- sealed abstract class TypeAnnotationTargetInMetodDeclaration extends TypeAnnotationTarget
- sealed abstract class TypeAnnotationTargetInVarDecl extends TypeAnnotationTargetInCode
- type TypeAnnotations = ArraySeq[TypeAnnotation]
- sealed abstract class TypeArgument extends SignatureElement
- See also
For matching signatures see Signature.
- trait TypeConversionFactory[T] extends AnyRef
A factory to create instruction sequences to convert one primitive type into another one.
- case class TypeDeclaration(objectType: ObjectType, isInterfaceType: Boolean, theSuperclassType: Option[ObjectType], theSuperinterfaceTypes: UIDSet[ObjectType]) extends Product with Serializable
Stores information about a type's supertypes.
- sealed abstract class TypeHierarchyInformation extends AnyRef
Represents the results of a type hierarchy related query.
- case class TypeIdentifier(t: Type) extends StructureIdentifier with Product with Serializable
- trait TypeSignature extends ReturnTypeSignature
- case class TypeVariableSignature(identifier: String) extends Signature with FieldTypeSignature with ThrowsSignature with Product with Serializable
- See also
For matching signatures see Signature.
- class TypesVisitor extends TraversingVisitor
Traverses a signature and calls for each
Type
the given method.Traverses a signature and calls for each
Type
the given method.Thread Safety
This class is thread-safe and reusable. I.e., you can use one instance of this visitor to simultaneously process multiple signatures. In this case, however, the given function
f
also has to be thread safe or you have to use different functions. - case class UninitializedVariableInfo(offset: Int) extends VerificationTypeInfo with Product with Serializable
- case class UnknownAttribute(attributeName: String, info: Array[Byte]) extends Attribute with Product with Serializable
Represents (as a byte array) attributes that are not directly supported by OPAL.
- case class UnpackedLineNumberTable(lineNumbers: LineNumbers) extends LineNumberTable with Product with Serializable
A method's line number table.
- type UpperTypeBound = UIDSet[ReferenceType]
An upper type bound represents the available type information about a reference value.
An upper type bound represents the available type information about a reference value. It is always "just" an upper bound for a concrete type; i.e., we know that the runtime type has to be a subtype (reflexive) of the type identified by the upper bound. Furthermore, an upper bound can identify multiple independent types. E.g., a type bound for array objects could be:
java.io.Serializable
andjava.lang.Cloneable
. Here, independent means that no two types of the bound are in a subtype relationship. Hence, an upper bound is always a special set where the values are not equal and are not in an inheritance relation. However, identifying independent types is a class hierarchy's responsibility.In general, an upper bound identifies a single class type and a set of independent interface types that are known to be implemented by the current object. Even if the type contains a class type it may just be a super class of the concrete type and, hence, just represent an abstraction.
- sealed abstract class VarianceIndicator extends SignatureElement
Indicates a TypeArgument's variance.
- sealed abstract class VerificationTypeInfo extends AnyRef
Part of the Java 6 stack map table attribute.
- type VerificationTypeInfoLocals = ArraySeq[VerificationTypeInfo]
- type VerificationTypeInfoStack = ArraySeq[VerificationTypeInfo]
- final case class VirtualClass(thisType: ObjectType) extends VirtualSourceElement with Product with Serializable
Represents a class for which we have found some references but have not analyzed any class file or do not want to keep the reference to the underlying class file.
- sealed abstract class VirtualClassMember extends VirtualSourceElement
- final class VirtualDeclaredMethod extends DeclaredMethod
Represents a method belonging to the API of the specified class type, where the original method definition is not available (in the context of the current analysis).
Represents a method belonging to the API of the specified class type, where the original method definition is not available (in the context of the current analysis). Note that one VirtualDeclaredMethod may represent more than one actual method, because a class may have several package-private methods with the same signature.
- final case class VirtualField(declaringClassType: ObjectType, name: String, fieldType: FieldType) extends VirtualClassMember with Product with Serializable
Represents a field of a virtual class.
- final case class VirtualForwardingMethod(declaringClassType: ReferenceType, name: String, descriptor: MethodDescriptor, target: Method) extends VirtualMethod with Product with Serializable
- sealed class VirtualMethod extends VirtualClassMember
Represents a method of a virtual class.
- sealed abstract class VirtualSourceElement extends SourceElement with Ordered[VirtualSourceElement]
A
VirtualSourceElement
is the representation of some source element that may be detached from the concrete source element that represents the implementation; that is, the virtual source element may not have a reference to the concrete element. - sealed abstract class VoidType extends Type with ReturnTypeSignature
Represents the Java type/keyword
void
. - sealed abstract class Wildcard extends TypeArgument
If a type argument is not further specified (e.g., List<?> l = …), then the type argument "?" is represented by this object.
If a type argument is not further specified (e.g., List<?> l = …), then the type argument "?" is represented by this object.
- See also
For matching signatures see Signature.
Value Members
- val Attributes: ArraySeq.type
- val BaseConfig: Config
- final val ConfigKeyPrefix: String("org.opalj.br.")
- val ElementValuePairs: ArraySeq.type
- val FieldTypes: ArraySeq.type
- final val FrameworkName: String("OPAL Bytecode Representation")
- val Methods: ArraySeq.type
- def NoAnnotations: ArraySeq[Annotation]
- final def NoAttributes: Attributes
- final def NoElementValuePairs: ElementValuePairs
- final def NoExceptionHandlers: ExceptionHandlers
- final def NoFieldTemplates: FieldTemplates
- final def NoFieldTypes: FieldTypes
- final def NoFields: Fields
- final def NoInterfaces: Interfaces
- final def NoMethodTemplates: MethodTemplates
- final def NoMethods: Methods
- final val NoPCs: IntTrieSet
- final def NoParameterAnnotations: ParameterAnnotations
- final def NoTypeAnnotations: ArraySeq[TypeAnnotation]
- val ObjectTypes: ArraySeq.type
- def annotationsToJava(annotations: Annotations, before: String = "", after: String = ""): String
Converts a given list of annotations into a Java-like representation.
- def classAccessFlagsToString(accessFlags: Int): String
- def classAccessFlagsToXHTML(accessFlags: Int): Node
- def methodAccessFlagsToString(accessFlags: Int): String
- def methodToXHTML(accessFlags: Int, name: String, descriptor: MethodDescriptor, abbreviateTypes: Boolean): Node
- def methodToXHTML(name: String, descriptor: MethodDescriptor, abbreviateTypes: Boolean = true): Node
Creates an (X)HTML5 representation that resembles Java source code method signature.
- final def newFieldTypesBuilder(): Builder[FieldType, ArraySeq[FieldType]]
- def registerIndexToParameterIndex(isStatic: Boolean, descriptor: MethodDescriptor, registerIndex: Int): Int
Calculates the parameter index associated with a method's local variable register index.
Calculates the parameter index associated with a method's local variable register index. The index of the first parameter is 0. If the method is not static the *this* reference stored in register index
0
has the parameter index-1
.- isStatic
true
if method is static and, hence, has no implicit parameter forthis
.- returns
The parameter index for the specified register.
- def typeToXHTML(accessFlags: Int, t: Type, abbreviateTypes: Boolean): Node
- def typeToXHTML(t: Type, abbreviateType: Boolean = true): Node
Creates an (X)HTML5 representation of the given Java type declaration.
- object Annotation extends Serializable
Factory object to create Annotation objects.
- object AnnotationTable
Functionality common to annotation tables.
- object AnnotationValue extends Serializable
- object ArrayElementType
Facilitates matching against an array's element type.
- object ArrayType
Defines factory and extractor methods for
ArrayType
s. - object ArrayTypeSignature extends Serializable
- object ArrayValue extends Serializable
- object BaseType
Common constants related to base types (aka.
Common constants related to base types (aka. primitive types).
- object BasicClassTypeSignature
Extractor/Matcher of the (potentially erased)
ObjectType
that is defined by aClassTypeSignature
; ignores all further potential type parameters.Extractor/Matcher of the (potentially erased)
ObjectType
that is defined by aClassTypeSignature
; ignores all further potential type parameters.- See also
For matching signatures see Signature.
- case object BooleanType extends BooleanType with Product with Serializable
- object BooleanValue extends Serializable
- object BootstrapMethodTable extends Serializable
- case object ByteType extends ByteType with Product with Serializable
- object ByteValue extends Serializable
- case object CTIntType extends CTIntType with Product with Serializable
In some cases we abstract over all computational type integer values.
- case object Category1ComputationalTypeCategory extends ComputationalTypeCategory with Product with Serializable
- case object Category2ComputationalTypeCategory extends ComputationalTypeCategory with Product with Serializable
- case object CharType extends CharType with Product with Serializable
- object CharValue extends Serializable
- object ChopFrame
- object ClassFile
Defines factory and extractor methods for
ClassFile
objects as well as related constants. - object ClassHierarchy
Factory methods for creating
ClassHierarchy
objects. - object ClassMember
Defines an extractor method for class members.
- object ClassSignature extends Serializable
- object ClassTypeSignature extends Serializable
- object ClassValue extends Serializable
- object Code
Defines constants useful when analyzing a method's code.
- object CompareAllConfiguration extends CompareAllConfiguration
- case object ComputationalTypeDouble extends ComputationalType with Product with Serializable
- case object ComputationalTypeFloat extends ComputationalType with Product with Serializable
- case object ComputationalTypeInt extends ComputationalType with Product with Serializable
- case object ComputationalTypeLong extends ComputationalType with Product with Serializable
- case object ComputationalTypeReference extends ComputationalType with Product with Serializable
- case object ComputationalTypeReturnAddress extends ComputationalType with Product with Serializable
- object ConcreteType
Matches a ClassTypeSignature with a SimpleClassTypeSignature that does not define a generic type.
Matches a ClassTypeSignature with a SimpleClassTypeSignature that does not define a generic type. For example,
java.lang.Object
.- See also
For matching signatures see Signature.
- object ConcreteTypeArgument
Facilitates matching ProperTypeArguments that define a single concrete/invariant type that is not a generic type on its own.
Facilitates matching ProperTypeArguments that define a single concrete/invariant type that is not a generic type on its own. E.g., it can be used to match the type argument of
List<Integer>
and to extract the concrete typeInteger
. It cannot be used to match, e.g.,List<List<Integer>>
.- See also
For matching signatures see Signature.
- object ConstantDouble extends Serializable
- object ConstantFloat extends Serializable
- object ConstantInteger extends Serializable
- object ConstantLong extends Serializable
- object ConstantString extends Serializable
- object ConstantValue
Facilitates matching constant values.
- case object ContravariantIndicator extends ContravariantIndicator with Product with Serializable
- case object CovariantIndicator extends CovariantIndicator with Product with Serializable
- case object Deprecated extends Attribute with Product with Serializable
The deprecated attribute.
- case object DoubleType extends DoubleType with Product with Serializable
- object DoubleValue extends Serializable
- case object DoubleVariableInfo extends VerificationTypeInfo with Product with Serializable
- object DynamicConstant
- object ElementReferenceType
- object ElementValue
- object ElementValuePair extends Serializable
- object EnclosingMethod extends Serializable
- object EnumValue extends Serializable
- object ExceptionTable extends Serializable
- object Field
Defines factory and extractor methods for
Field
objects. - object FieldType
Factory to parse field type (descriptors) to get field type objects.
- object FieldTypeJVMSignature
- object FieldTypeSignature
- case object FloatType extends FloatType with Product with Serializable
- object FloatValue extends Serializable
- case object FloatVariableInfo extends VerificationTypeInfo with Product with Serializable
- object GenericType
Matches all ClassTypeSignatures which consists of a SimpleClassTypeSignature with a non-empty List of TypeArguments ( which consists of Wildcards or ProperTypeArguments)
Matches all ClassTypeSignatures which consists of a SimpleClassTypeSignature with a non-empty List of TypeArguments ( which consists of Wildcards or ProperTypeArguments)
- See also
For matching signatures see Signature.
- object GenericTypeArgument
Facilitates matching the (
VarianceIndicator
,ObjectType
) that is defined within aProperTypeArgument
.Facilitates matching the (
VarianceIndicator
,ObjectType
) that is defined within aProperTypeArgument
. It matches ProperTypeArguments which defineTypeArgument
s in the inner ClassTypeSignature.matches e.g.:
List<List<Integer>>
val scts : SimpleClassTypeSignature = ... scts.typeArguments match { case GenericTypeArgument(varInd, objectType) => ... case _ => ... }
- See also
For matching signatures see Signature.
Example: - object GenericTypeWithClassSuffix
Matches all ClassTypeSignatures which consists of a SimpleClassTypeSignature with an optional list of TypeArguments ( which consists of Wildcards or ProperTypeArguments) and a non-empty list of SimpleClassTypeSignature (which encodes the suffix of the ClassTypeSignature for inner classes)
Matches all ClassTypeSignatures which consists of a SimpleClassTypeSignature with an optional list of TypeArguments ( which consists of Wildcards or ProperTypeArguments) and a non-empty list of SimpleClassTypeSignature (which encodes the suffix of the ClassTypeSignature for inner classes)
- See also
For matching signatures see Signature.
- object HasNoArgsAndReturnsVoid
- object InnerClassTable extends Serializable
- object IntValue extends Serializable
- case object IntegerType extends IntegerType with Product with Serializable
- case object IntegerVariableInfo extends VerificationTypeInfo with Product with Serializable
- object JVMMethodDescriptor
Extractor for JVM method descriptors (for example, "(I[Ljava/lang/Object;])V").
- object LineNumberTable
- object LocalVariableTable extends Serializable
- object LocalVariableTypeTable extends Serializable
- case object LongType extends LongType with Product with Serializable
- object LongValue extends Serializable
- case object LongVariableInfo extends VerificationTypeInfo with Product with Serializable
- object LowerTypeBound
Facilitates matching ProperTypeArguments that define a lower type bound.
Facilitates matching ProperTypeArguments that define a lower type bound. E.g., a type bound which uses a ContravarianceIndicator (
? super
) such as inList<? super Number>
.matches, e.g.,
List<? super Integer>
val scts : SimpleClassTypeSignature = ... scts.typeArguments.head match { case LowerTypeBound(objectType) => ... case _ => ... }
- See also
For matching signatures see Signature.
Example: - object Method
Defines factory and extractor methods for
Method
objects. - object MethodCallMethodHandle
- object MethodDescriptor
Defines extractor and factory methods for MethodDescriptors.
- object MethodParameterTable extends Serializable
- object MethodTypeSignature extends Serializable
- object MethodWithBody
Provides efficient pattern matching facilities for methods with bodies.
Provides efficient pattern matching facilities for methods with bodies.
Matching all methods that have a method body:
for { classFile <- project.classFiles method @ MethodWithBody(code) <- classFile.methods } { // the type of method is "..resolved.Method" // the type of code is "..resolved.Code" }
Example: - object Module extends Serializable
- object ModuleMainClass extends Serializable
- object ModulePackages extends Serializable
- object NestHost extends Serializable
- object NestMembers extends Serializable
- object NoArgumentMethodDescriptor
- object NotJavaLangObject
Defines an extractor to match a type against any
ObjectType
exceptjava.lang.Object
.Defines an extractor to match a type against any
ObjectType
exceptjava.lang.Object
.val t : Type = ... t match { case ot @ NotJavaLangObject() => ot case _ => }
Example: - object NotVoid
Defines an extractor to match against any
Type
exceptvoid
.Defines an extractor to match against any
Type
exceptvoid
. Can be useful, e.g., when matchingMethodDescriptor
s to select all methods that return something. - case object NullVariableInfo extends VerificationTypeInfo with Product with Serializable
- object ObjectType
Defines factory and extractor methods for
ObjectType
s. - object PCAndAnyRef
- object PCAndInstruction
- object PCInMethod
- object ParameterAnnotationTable
- object PermittedSubclasses extends Serializable
- object Record extends Serializable
- object ReferenceType
Factory to create instances of
ReferenceType
. - object ReturnType
- object RuntimeInvisibleAnnotationTable extends Serializable
- object RuntimeInvisibleParameterAnnotationTable extends Serializable
- object RuntimeInvisibleTypeAnnotationTable extends Serializable
- object RuntimeVisibleAnnotationTable extends Serializable
- object RuntimeVisibleParameterAnnotationTable extends Serializable
- object RuntimeVisibleTypeAnnotationTable extends Serializable
- case object ShortType extends ShortType with Product with Serializable
- object ShortValue extends Serializable
- object Signature
- object SimpleGenericType
Facilitates matching ClassTypeSignatures that define a simple generic type that has a single type argument with a concrete type.
Facilitates matching ClassTypeSignatures that define a simple generic type that has a single type argument with a concrete type.
The following can be used to match, e.g.,
List<Object>
.val f : Field = ... f.fieldTypeSignature match { case SimpleGenericType(ContainerType,ElementType) => ... case _ => ... }
Example: - object SingleArgumentMethodDescriptor
Extractor for method descriptors defining a single parameter type and some return type.
- object SourceDebugExtension extends Serializable
- object SourceFile extends Serializable
- object StackMapTable extends Serializable
- object StringValue extends Serializable
- object SubtypeInformation
Factory to create the subtype information data structure.
- object SupertypeInformation
- object SynthesizedClassFiles extends Serializable
- case object Synthetic extends Attribute with Product with Serializable
The synthetic attribute.
- case object TADeeperInArrayType extends TypeAnnotationPathElement with Product with Serializable
- case object TADeeperInNestedType extends TypeAnnotationPathElement with Product with Serializable
- case object TADirectlyOnType extends TypeAnnotationPath with Product with Serializable
- case object TAOfFieldDeclaration extends TypeAnnotationTargetInFieldDeclaration with Product with Serializable
- case object TAOfReceiverType extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case object TAOfReturnType extends TypeAnnotationTargetInMetodDeclaration with Product with Serializable
- case object TAOnBoundOfWildcardType extends TypeAnnotationPathElement with Product with Serializable
- object TAOnTypeArgument extends Serializable
- object TheArgument
Extractor for method descriptors defining a single parameter type.
- case object TopVariableInfo extends VerificationTypeInfo with Product with Serializable
- object TwoArgumentsMethodDescriptor
- object Type
- object TypeAnnotationTable
Functionality common to annotation tables.
- object TypeVariableSignature extends Serializable
- case object UninitializedThisVariableInfo extends VerificationTypeInfo with Product with Serializable
- object UnknownAttribute extends Serializable
- object UpperTypeBound
Facilitates matching ProperTypeArguments that define an upper type bound.
Facilitates matching ProperTypeArguments that define an upper type bound. E.g., a type bound which uses a CovarianceIndicator (
? extends
) such as inList<? extends Number>
.val scts : SimpleClassTypeSignature = ... scts.typeArguments.head match { case UpperTypeBound(objectType) => ... case _ => ... }
- See also
For matching signatures see Signature.
Example: - object VirtualMethod
- object VirtualSourceElement
Defines common helper functions related to VirtualSourceElements.
- case object VirtualTypeFlag extends Attribute with Product with Serializable
This class file level attribute identifies ClassFile objects that have no direct representation in the bytecode of a project.
This class file level attribute identifies ClassFile objects that have no direct representation in the bytecode of a project.
Instead, the class file annotated with this attribute was generated to represent a class file object that is either explicitly generated at runtime and then used by the program or is conceptually generated at runtime by the JavaVM, but not exposed to the program. An example of the later case are the call site objects that are generated for
invokedynamic
instructions.However, such classes are generally required to facilitate subsequent analyses.
- case object VoidType extends VoidType with Product with Serializable
- case object Wildcard extends Wildcard with Product with Serializable