Module Type
Provides classes and predicates for working with Java types.
Types can be primitive types (PrimitiveType
), array types (Array
), or reference
types (RefType
), where the latter are either classes (Class
) or interfaces
(Interface
).
Reference types can be at the top level (TopLevelType
) or nested (NestedType
).
Classes and interfaces can also be local (LocalClassOrInterface
, LocalClass
) or anonymous (AnonymousClass
).
Enumerated types (EnumType
) and records (Record
) are special kinds of classes.
Import path
import semmle.code.java.Type
Imports
JDK | Provides classes and predicates for working with standard classes and methods from the JDK. |
Member | Provides classes and predicates for working with members of Java classes and interfaces, that is, methods, constructors, fields and nested types. |
Modifier | Provides classes and predicates for working with Java modifiers. |
Predicates
declaresMember | Holds if type |
erasedHaveIntersection | Holds if there is a common (reflexive, transitive) subtype of the erased types |
hasDescendant | Holds if reference type |
hasSubtype | Holds if reference type |
haveIntersection | Holds if there is a common (reflexive, transitive) subtype of the erasures of types |
notHaveIntersection | Holds if there is no common (reflexive, transitive) subtype of the erasures of types |
Classes
AnonymousClass | An anonymous class. |
Array | An array type. |
BooleanType | A boolean type, which may be either a primitive or a boxed type. |
BoxedType | A boxed type. |
CharacterType | A character type, which may be either a primitive or a boxed type. |
Class | A class declaration. |
ClassObject | A Kotlin |
ClassOrInterface | A class or interface. |
CompanionObject | A Kotlin |
DataClass | A Kotlin data class declaration. |
EnumConstant | An enum constant is a member of a enum type. |
EnumType | An enumerated type. |
ErrorType | An |
FloatingPointType | A floating point type, which may be either a primitive or a boxed type. |
FunctionalInterface | A functional interface is an interface that has just one abstract method (aside from the methods of Object), and thus represents a single function contract. |
InnerClass | An inner class is a nested class that is neither explicitly nor implicitly declared static. This includes anonymous and local classes. |
IntegralType | An integral type, which may be either a primitive or a boxed type. This includes the types |
Interface | An interface. |
IntersectionType | An intersection type. |
LocalClass | A local class. |
LocalClassOrInterface | A local class or interface. |
MemberType | A nested type which is a direct member of the enclosing type, that is, neither an anonymous nor local class. |
NestedClass | A class declared within another type. |
NestedType | A nested type is a type declared within another type. |
NullType | The type of the |
NumericOrCharType | A numeric or character type, which may be either a primitive or a boxed type. |
NumericType | A numeric type, including both primitive and boxed types. |
PrimitiveType | A primitive type. |
Record | A record declaration. |
RefType | A common super-class for various kinds of reference types, including classes, interfaces, type parameters and arrays. |
SrcRefType | A type that is the same as its source declaration. |
TopLevelClass | A top-level class. |
TopLevelType | A top-level type. |
Type | A common abstraction for all Java types, including primitive, class, interface and array types. |
VoidType | The |