edu.umd.cs.findbugs.ba.type2
Interface Type

All Known Subinterfaces:
ReferenceType
All Known Implementing Classes:
ArrayType, BasicType, BottomType, ClassType, DoubleExtraType, LongExtraType, NullType, ObjectType, ReturnAddressType, TopType

public interface Type

Interface for objects representing Java types. In general, an Type provides a type for a value used in a Java method. Types of values include:

This class and its descendents were designed to address some shortcomings of the BCEL Type class and descendents:

  1. They are not interned, meaning that many objects may exist representing a single type.
  2. BCEL reference types are inconsistent about whether a signature or class name is used to create them.
  3. BCEL's ArrayType class is not a subtype of ObjectType: this is just wrong, IMO.
  4. BCEL has no data structure to represent a class hierarchy: subtype relationships are discovered by a series of repository lookups. (This also makes questions like "what are all of the direct subclasses of this class" difficult to answer efficiently.)
  5. BCEL has no built-in representation for dataflow top and bottom types.

The goals of Type and related classes are to be efficient in dataflow analysis, and to make class hierarchy queries flexible and easy.

Author:
David Hovemeyer

Method Summary
 void accept(TypeVisitor visitor)
          Accept an TypeVisitor.
 java.lang.String getSignature()
          Return the JVM type signature.
 int getTypeCode()
          Return the type code value as defined in org.apache.bcel.Constants or ExtendedTypes.
 boolean isBasicType()
          Is this type a basic type?
 boolean isReferenceType()
          Is this type a reference type?
 boolean isValidArrayBaseType()
          Is this a valid array base type?
 boolean isValidArrayElementType()
          Is this a valid array element type?
 

Method Detail

getSignature

java.lang.String getSignature()
Return the JVM type signature. Note that some types do not have valid JVM signature representations. For example, the type of the null reference value cannot be represented as a signature. However, all basic types, class types, and array types have JVM signatures.


getTypeCode

int getTypeCode()
Return the type code value as defined in org.apache.bcel.Constants or ExtendedTypes.


isBasicType

boolean isBasicType()
Is this type a basic type?


isReferenceType

boolean isReferenceType()
Is this type a reference type?


isValidArrayElementType

boolean isValidArrayElementType()
Is this a valid array element type?


isValidArrayBaseType

boolean isValidArrayBaseType()
Is this a valid array base type?


accept

void accept(TypeVisitor visitor)
Accept an TypeVisitor.

Parameters:
visitor - the visitor