The access flags of this class.
The access flags of this class. To further analyze the access flags either use the corresponding convenience methods (e.g., isEnumDeclaration()) or the class org.opalj.bi.AccessFlagsIterator or the classes which inherit from org.opalj.bi.AccessFlag.
The list of all annotations.
The list of all annotations. In general, if a specific annotation is searched for the method runtimeVisibleAnnotations or runtimeInvisibleAnnotations should be used.
This class file's reified attributes.
This class file's reified attributes. Which attributes are reified depends on the configuration of the class file reader; e.g., org.opalj.br.reader.Java8Framework. The JVM specification defines the following attributes:
Each class file optionally defines a class signature.
All constructors/instance initialization methods (<init>
) defined by this class.
All constructors/instance initialization methods (<init>
) defined by this class.
(This does not include static initializers.)
The declared fields.
The declared fields. May be empty. The list is sorted by name.
Returns the field with the given name, if any.
Returns the field with the given name, if any.
The complexity is O(log2 n); this algorithm uses binary search.
Returns the method with the given name and descriptor that is declared by this class file.
Returns the method with the given name and descriptor that is declared by this class file.
The complexity is O(log2 n); this algorithm uses a binary search algorithm.
Returns the method with the given name, if any.
Returns the method with the given name, if any.
The complexity is O(log2 n); this algorithm uses binary search.
,Though the methods are sorted, no guarantee is given which method is returned if multiple methods are defined with the same name.
Iterates over all direct and indirect nested classes of this class file.
Iterates over all direct and indirect nested classes of this class file.
To collect all nested types:
var allNestedTypes: Set[ObjectType] = Set.empty foreachNestedClasses(innerclassesProject, { nc ⇒ allNestedTypes += nc.thisType })
The fully qualified name of the type defined by this class file.
This class file's hasCode
.
This class file's hasCode
. The hashCode
is (by purpose) identical to
the id of the ObjectType
it implements.
The unique id associated with the type defined by this class file.
Returns the inner classes attribute
, if defined.
Returns the inner classes attribute
, if defined.
The inner classes attribute contains (for inner classes) also a reference to its outer class. Furthermore, it contains references to other inner classes that are not an inner class of this class. If you are just interested in the inner classes of this class, use the method nested classes.
All defined instance methods.
All defined instance methods. I.e., all methods that are not static, constructors, or static initializers.
The set of implemented interfaces.
The set of implemented interfaces. May be empty.
Returns true
if this class file defines an anonymous inner class.
Returns true
if this class file defines an anonymous inner class.
This method relies on the inner classes attribute to identify anonymous inner classes.
Returns true if this (field, method, class) declaration is declared as deprecated.
Returns true if this (field, method, class) declaration is declared as deprecated.
The deprecated attribute is always set by the Java compiler when either the deprecated annotation or the JavaDoc tag is used.
Returns true
if the class is final or if it only defines private constructors.
Returns true if this class file represents an interface.
Returns true if this class file represents an interface.
From the JVM point-of-view annotations are also interfaces!
true
if the class file has package visibility.
true
if the class file has package visibility. If false
the method isPublic
will return true
.
There is no private or protected visibility.
true
if the class file has public visibility.
true
if the class file has public visibility. If false
the method isPackageVisible
will return true
.
There is no private or protected visibility.
True
if this element was created by the compiler and the attribute Synthetic
is present.
True
if this element was created by the compiler and the attribute Synthetic
is present. Compilers are, however, free to use the attribute or the corresponding
access flag.
Returns true
if this class file has no direct representation in the source code.
Returns true
if this class file has no direct representation in the source code.
VirtualTypeFlag for further information.
The declared methods.
The declared methods. May be empty. The list is first sorted by name, and then by method descriptor.
Returns the set of all immediate nested classes of this class.
Returns the set of all immediate nested classes of this class. I.e., returns those nested classes that are not defined in the scope of a nested class of this class.
Each class has at most one explicit, direct outer type.
Each class has at most one explicit, direct outer type. Note that a local class (a class defined in the scope of a method) or an anonymous class do not specify an outer type.
The object type of the outer type as well as the access flags of this inner class.
The SourceDebugExtension attribute is an optional attribute [...].
The SourceDebugExtension attribute is an optional attribute [...]. There can be
at most one SourceDebugExtension
attribute. The data (which is modified UTF8
String may, however, not be representable using a String object (see the
spec. for further details.)
The returned Array must not be mutated.
The SourceFile attribute is an optional attribute [...].
The SourceFile attribute is an optional attribute [...]. There can be
at most one SourceFile
attribute.
The static initializer of this class.
The static initializer of this class.
The way how the static initializer is identified has changed with Java 7. In a class file whose version number is 51.0 or above, the method must have its ACC_STATIC flag set. Other methods named <clinit> in a class file are of no consequence.
The class type from which this class inherits.
The class type from which this class inherits. None
if this
class file defines java.lang.Object
.
The type implemented by this class file.
The list of all type annotations.
The list of all type annotations. In general, if a specific type annotation is searched for, the method runtimeVisibleTypeAnnotations or runtimeInvisibleTypeAnnotations should be used.
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.)Equality of
ClassFile
objects is reference based and a class file's hash code is the same asthisType
's hash code.