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 can also be local (LocalClass) or anonymous (AnonymousClass). Enumerated types (EnumType) are a special kind of class.

Import path

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 t declares member m.

erasedHaveIntersection

Holds if there is a common (reflexive, transitive) subtype of the erased types t1 and t2.

hasSubtype

Holds if reference type t is an immediate super-type of sub.

hasSubtypeStar

DEPRECATED: Use hasSubtype* instead.

haveIntersection

Is there a common (reflexive, transitive) subtype of the erasures of types t1 and t2?

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.

ClassOrInterface

A class or interface.

EnumConstant

An enum constant is a member of a enum type.

EnumType

An enumerated type.

FloatingPointType

A floating point type, which may be either a primitive or a boxed type.

InnerClass

An inner class is a nested class that is neither explicitly nor implicitly declared static.

IntegralType

An integral type, which may be either a primitive or a boxed type.

Interface

An interface.

IntersectionType

An intersection type.

LocalClass

A 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 null literal.

NumericOrCharType

A numeric or character type, which may be either a primitive or a boxed type.

PrimitiveType

A primitive type.

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 void type.