package bi
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.
- Source
- package.scala
- Alphabetic
- By Inheritance
- bi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait AccessFlag extends PrimitiveAccessFlagsMatcher
A class, field or method declaration's access flags.
A class, field or method declaration's access flags. An access flag (e.g.,
public
orstatic
) is basically just a specific bit that can be combined with other access flags to create an integer based bit vector that represents all flags defined for a class, method or field declaration. Access flags are generally context dependent and the same value means different things depending on the context. - final type AccessFlagsContext = bi.AccessFlagsContexts.Value
- class AccessFlagsIterator extends Iterator[AccessFlag]
Enables iterating over a class( file member)'s access flags.
Enables iterating over a class( file member)'s access flags. I.e., given the access flags of a class file, a field or a method, it is then possible to iterate over the flags (synthetic, public, deprecated, etc.) that are set.
- sealed trait AccessFlagsMatcher extends AnyRef
Matches a given access flags bit array and enables the construction of complex matchers.
- final type AttributeParent = bi.AttributesParent.Value
- final type ConstantPoolTag = bi.ConstantPoolTags.Value
- trait PrimitiveAccessFlagsMatcher extends AccessFlagsMatcher
- sealed abstract class ReferenceKind extends AnyRef
Common super class of the
reference_kind
s used by the constant pool's CONSTANT_MethodHandle_info structure. - sealed trait VisibilityModifier extends AccessFlag
Common supertype of all explicit visibility modifiers/access flags.
Value Members
- final val ClassFileMagic: Int(-889275714)
Every Java class file starts with "0xCAFEBABE".
- final val Java10MajorVersion: Int(54)
- final val Java10Version: UShortPair
- final val Java11MajorVersion: Int(55)
- final val Java11Version: UShortPair
- final val Java12MajorVersion: Int(56)
- final val Java12Version: UShortPair
- final val Java13MajorVersion: Int(57)
- final val Java13Version: UShortPair
- final val Java14MajorVersion: Int(58)
- final val Java14Version: UShortPair
- final val Java15MajorVersion: Int(59)
- final val Java15Version: UShortPair
- final val Java16MajorVersion: Int(60)
- final val Java16Version: UShortPair
- final val Java17MajorVersion: Int(61)
- final val Java17Version: UShortPair
- final val Java18MajorVersion: Int(62)
- final val Java18Version: UShortPair
- final val Java19MajorVersion: Int(63)
- final val Java19Version: UShortPair
- final val Java1MajorVersion: Int(45)
- final val Java1_2MajorVersion: Int(46)
- final val Java5MajorVersion: Int(49)
- final val Java5Version: UShortPair
- final val Java6MajorVersion: Int(50)
- final val Java6Version: UShortPair
- final val Java7MajorVersion: Int(51)
- final val Java7Version: UShortPair
- final val Java8MajorVersion: Int(52)
- final val Java8Version: UShortPair
- final val Java9MajorVersion: Int(53)
- final val Java9Version: UShortPair
- final val LatestSupportedJavaMajorVersion: Int(63)
The latest major version supported by OPAL; this constant is adapted whenever a new version is supported.
- final val LatestSupportedJavaVersion: UShortPair
The latest version supported by OPAL; this constant is adapted whenever a new version is supported.
- val MissingLibraryWarning: String
- final lazy val isCurrentJREAtLeastJava10: Boolean
- final lazy val isCurrentJREAtLeastJava11: Boolean
- final lazy val isCurrentJREAtLeastJava15: Boolean
- final lazy val isCurrentJREAtLeastJava16: Boolean
- final lazy val isCurrentJREAtLeastJava17: Boolean
- final lazy val isCurrentJREAtLeastJava8: Boolean
Returns
true
if the current JRE is at least Java 8 or a newer version.Returns
true
if the current JRE is at least Java 8 or a newer version.- Note
This method makes some assumptions how the version numbers will evolve.
- def jdkVersion(majorVersion: Int): String
Returns a textual representation of the Java version used to create the respective class file.
- final def warnMissingLibrary(implicit ctx: LogContext): Unit
- object ACC_ABSTRACT extends AccessFlag
- object ACC_ANNOTATION extends AccessFlag
- object ACC_BRIDGE extends AccessFlag
- object ACC_ENUM extends AccessFlag
- object ACC_FINAL extends AccessFlag
- object ACC_INTERFACE extends AccessFlag
- object ACC_MANDATED extends AccessFlag
- object ACC_MODULE extends AccessFlag
Identifies a class as defining a Java 9 module.
Identifies a class as defining a Java 9 module.
- Note
From the specification: "If ACC_MODULE is set in ClassFile.access_flags, then no other flag in
,ClassFile.access_flags
may be set." The name of the class has to be "/module-info".super_class, interfaces_count, fields_count, methods_count: zero. I.e., a module does not have a super class.
- object ACC_NATIVE extends AccessFlag
- object ACC_OPEN extends AccessFlag
- object ACC_PRIVATE extends VisibilityModifier
- object ACC_PROTECTED extends VisibilityModifier
- object ACC_PUBLIC extends VisibilityModifier
- object ACC_STATIC extends AccessFlag
- object ACC_STATIC_PHASE extends AccessFlag
- Note
From the JVM 9 specification: "Indicates that this [inter-module] dependence is mandatory in the static phase, i.e., at compile time, but is optional in the dynamic phase, i.e., at run time."
,Only used in combination with Java 9 modules.
- object ACC_STRICT extends AccessFlag
- object ACC_SUPER extends AccessFlag
- object ACC_SYNCHRONIZED extends AccessFlag
- object ACC_SYNTHETIC extends AccessFlag
- object ACC_TRANSIENT extends AccessFlag
- object ACC_TRANSITIVE extends AccessFlag
- Note
From the JVM 9 specification: "Indicates that any module which depends on the current module, implicitly declares a dependence on the module indicated by this entry."
,Only used in combination with Java 9 modules.
- object ACC_VARARGS extends AccessFlag
- object ACC_VOLATILE extends AccessFlag
- object AccessFlags
Convenience methods related to access flags.
- object AccessFlagsContexts extends Enumeration
Enumeration of the different contexts in which the JVM Spec.
Enumeration of the different contexts in which the JVM Spec. uses
access_flags
fields and also an enumeration whichaccess_flags
are found in which context. - object AccessFlagsIterator
Factory for creating
AccessFlagsIterator
objects. - object AccessFlagsMatcher
Predefines several access flags matchers.
Predefines several access flags matchers.
The predefined matchers are used in the following way:
method match { case Method(PUBLIC_STATIC(),...) => ... } field match { case Field(PUBLIC_STATIC_FINAL(),...) => ... }
Example: - object AnnotationDefaultAttribute
Common properties of
AnnotationDefault
attributes. - object AttributesParent extends Enumeration
Enumeration of all class file structures that can have attributes.
- object BootstrapMethodsAttribute
- object CodeAttribute
- object ConstantPoolTags extends Enumeration
A constant pool tag identifies the type of a specific entry in the constant pool.
- object ConstantValueAttribute
- object DeprecatedAttribute
- object EnclosingMethodAttribute
- object ExceptionsAttribute
- object InnerClassesAttribute
- object LineNumberTableAttribute
- object LocalVariableTableAttribute
- object LocalVariableTypeTableAttribute
- object MethodParametersAttribute
- object ModuleAttribute
- object ModuleMainClassAttribute
- object ModulePackagesAttribute
- object NestHostAttribute
- object NestMembersAttribute
- object PermittedSubclassesAttribute
- object PrimitiveAccessFlagsMatcher
Extractor for the bitmask used by a PrimitiveAccessFlagsMatcher.
- case object REF_getField extends ReferenceKind with Product with Serializable
- case object REF_getStatic extends ReferenceKind with Product with Serializable
- case object REF_invokeInterface extends ReferenceKind with Product with Serializable
- case object REF_invokeSpecial extends ReferenceKind with Product with Serializable
- case object REF_invokeStatic extends ReferenceKind with Product with Serializable
- case object REF_invokeVirtual extends ReferenceKind with Product with Serializable
- case object REF_newInvokeSpecial extends ReferenceKind with Product with Serializable
- case object REF_putField extends ReferenceKind with Product with Serializable
- case object REF_putStatic extends ReferenceKind with Product with Serializable
- object RecordAttribute
- object ReferenceKind
Factory for
ReferenceKind
objects. - object RuntimeInvisibleAnnotationsAttribute
Common properties of
RuntimeInvisibleAnnotations
. - object RuntimeInvisibleParameterAnnotationsAttribute
Common properties of the
RuntimeInvisibleParameterAnnotations
attribute. - object RuntimeInvisibleTypeAnnotationsAttribute
Common properties of
RuntimeInvisibleTypeAnnotations
attributes. - object RuntimeVisibleAnnotationsAttribute
Common properties of
RuntimeVisibleAnnotations
attributes. - object RuntimeVisibleParameterAnnotationsAttribute
Common properties of
RuntimeVisibleParameterAnnotations
attributes. - object RuntimeVisibleTypeAnnotationsAttribute
Common properties of
RuntimeVisibleTypeAnnotations
attributes. - object SignatureAttribute
- object SourceDebugExtensionAttribute
- object SourceFileAttribute
- object StackMapTableAttribute
- object SyntheticAttribute
- object VisibilityModifier
Defines extractor methods related to visibility modifiers.