Package edu.umd.cs.findbugs.ba.generic
Class GenericObjectType
java.lang.Object
org.apache.bcel.generic.Type
org.apache.bcel.generic.ReferenceType
org.apache.bcel.generic.ObjectType
edu.umd.cs.findbugs.ba.generic.GenericObjectType
public class GenericObjectType
extends org.apache.bcel.generic.ObjectType
Extension to ObjectType that includes additional information about the
generic signature.
A GenericObjectType is either a parameterized type e.g.
List<String>
, or a type variable e.g. T
.
This class cannot be initialized directly. Instead, create a GenericObjectType by calling GenericUtilities.getType(String) and passing in the bytecode signature for the type.
- Author:
- Nat Ayewah
-
Field Summary
Fields inherited from class org.apache.bcel.generic.Type
BOOLEAN, BYTE, CHAR, CLASS, DOUBLE, FLOAT, INT, LONG, NO_ARGS, NULL, OBJECT, SHORT, signature, STRING, STRINGBUFFER, THROWABLE, type, UNKNOWN, VOID
-
Method Summary
Modifier and TypeMethodDescriptionboolean
org.apache.bcel.generic.Type
int
org.apache.bcel.generic.ObjectType
org.apache.bcel.generic.ReferenceType
getParameterAt
(int index) List
<? extends org.apache.bcel.generic.ReferenceType> Get the TypeCategory that represents this Objectorg.apache.bcel.generic.Type
int
hashCode()
boolean
org.apache.bcel.generic.ReferenceType
produce()
toString()
toString
(boolean includeGenerics) Return a string representation of this object.Methods inherited from class org.apache.bcel.generic.ObjectType
accessibleTo, getClassName, getInstance, referencesClass, referencesClassExact, referencesInterface, referencesInterfaceExact, subclassOf
Methods inherited from class org.apache.bcel.generic.ReferenceType
firstCommonSuperclass, getFirstCommonSuperclass, isAssignmentCompatibleWith, isCastableTo
Methods inherited from class org.apache.bcel.generic.Type
getArgumentTypes, getMethodSignature, getReturnType, getSignature, getSignature, getSize, getType, getType, getType, getTypes, normalizeForStackOrLocal
-
Method Details
-
produce
public org.apache.bcel.generic.ReferenceType produce() -
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.apache.bcel.generic.ObjectType
-
equals
- Overrides:
equals
in classorg.apache.bcel.generic.ObjectType
-
getUpperBound
public org.apache.bcel.generic.Type getUpperBound() -
getExtension
public org.apache.bcel.generic.Type getExtension()- Returns:
- Returns the extension.
-
getVariable
- Returns:
- Returns the variable.
-
getTypeCategory
Get the TypeCategory that represents this Object- See Also:
-
hasParameters
public boolean hasParameters()- Returns:
- true if this GenericObjectType represents a parameterized type
e.g.
List<String>
. This implies that isVariable() is falses
-
getNumParameters
public int getNumParameters()- Returns:
- the number of parameters if this is a parameterized class, 0 otherwise
-
getParameterAt
public org.apache.bcel.generic.ReferenceType getParameterAt(int index) - Parameters:
index
- should be less than getNumParameters()- Returns:
- the type parameter at index
-
getParameters
-
getObjectType
public org.apache.bcel.generic.ObjectType getObjectType()- Returns:
- the underlying ObjectType for this Generic Object
-
toString
Return a string representation of this object. (I do not overridetoString()
in case any existing code assumes that this object is an ObjectType and expects similar string representation. i.e.toString()
is equivalent totoString(false)
)- Parameters:
includeGenerics
- if true then the string includes generic information in this object. Otherwise this returns the same value as ObjectType.toString()
-
toString
- Overrides:
toString
in classorg.apache.bcel.generic.Type
-
toPlainString
-
getGenericParametersAsString
-