Package soot
Class RefType
- java.lang.Object
-
- soot.Type
-
- soot.RefLikeType
-
- soot.RefType
-
- All Implemented Interfaces:
Serializable,Comparable<RefType>,Numberable,Switchable
- Direct Known Subclasses:
ModuleRefType,WeakObjectType
public class RefType extends RefLikeType implements Comparable<RefType>
A class that models Java's reference types. RefTypes are parameterized by a class name. Two RefType are equal iff they are parameterized by the same class name as a String.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRefType(String className)RefType(Singletons.Global g)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Switch sw)Method required for use of Switchable.intcompareTo(RefType t)booleanequals(Object t)Two RefTypes are considered equal if they are parameterized by the same class name String.AnySubTypegetAnySubType()TypegetArrayElementType()If I have a variable x of declared type t, what is a good declared type for the expression ((Object[]) x)[i]? The getArrayElementType() method in RefLikeType was introduced even later to answer this question for all classes implementing RefLikeType.StringgetClassName()SootClassgetSootClass()Get the SootClass object corresponding to this RefType.inthashCode()booleanhasSootClass()booleanisAllowedInFinalCode()Returnstrueif this type is allowed to appear in final (clean) Jimple code.Typemerge(Type other, Scene cm)Returns the least common superclass of this type and other.voidsetAnySubType(AnySubType anySubType)voidsetClassName(String className)voidsetSootClass(SootClass sootClass)Set the SootClass object corresponding to this RefType.StringtoQuotedString()Returns a textual representation, quoted as needed, of this type for serialization, e.g.StringtoString()Returns a textual representation of this type.static RefTypev()static RefTypev(String className)Create a RefType for a class.static RefTypev(SootClass c)Create a RefType for a class.-
Methods inherited from class soot.Type
getArrayType, getDefaultFinalType, getEscapedName, getNumber, makeArrayType, setArrayType, setNumber, toMachineType
-
-
-
-
Field Detail
-
sootClass
protected volatile SootClass sootClass
-
-
Constructor Detail
-
RefType
public RefType(Singletons.Global g)
-
RefType
protected RefType(String className)
-
-
Method Detail
-
v
public static RefType v()
-
v
public static RefType v(String className)
Create a RefType for a class.- Parameters:
className- The name of the class used to parameterize the created RefType.- Returns:
- a RefType for the given class name.
-
v
public static RefType v(SootClass c)
Create a RefType for a class.- Parameters:
c- A SootClass for which to create a RefType.- Returns:
- a RefType for the given SootClass..
-
getClassName
public String getClassName()
-
compareTo
public int compareTo(RefType t)
- Specified by:
compareToin interfaceComparable<RefType>
-
getSootClass
public SootClass getSootClass()
Get the SootClass object corresponding to this RefType.- Returns:
- the corresponding SootClass
-
hasSootClass
public boolean hasSootClass()
-
setClassName
public void setClassName(String className)
-
setSootClass
public void setSootClass(SootClass sootClass)
Set the SootClass object corresponding to this RefType.- Parameters:
sootClass- The SootClass corresponding to this RefType.
-
equals
public boolean equals(Object t)
Two RefTypes are considered equal if they are parameterized by the same class name String.
-
toString
public String toString()
Description copied from class:TypeReturns a textual representation of this type.
-
toQuotedString
public String toQuotedString()
Returns a textual representation, quoted as needed, of this type for serialization, e.g. to .jimple format- Overrides:
toQuotedStringin classType
-
apply
public void apply(Switch sw)
Description copied from class:TypeMethod required for use of Switchable.- Specified by:
applyin interfaceSwitchable- Overrides:
applyin classType
-
merge
public Type merge(Type other, Scene cm)
Returns the least common superclass of this type and other.
-
getArrayElementType
public Type getArrayElementType()
Description copied from class:RefLikeTypeIf I have a variable x of declared type t, what is a good declared type for the expression ((Object[]) x)[i]? The getArrayElementType() method in RefLikeType was introduced even later to answer this question for all classes implementing RefLikeType. If t is an array, then the answer is the same as getElementType(). But t could also be Object, Serializable, or Cloneable, which can all hold any array, so then the answer is Object.- Specified by:
getArrayElementTypein classRefLikeType
-
getAnySubType
public AnySubType getAnySubType()
-
setAnySubType
public void setAnySubType(AnySubType anySubType)
-
isAllowedInFinalCode
public boolean isAllowedInFinalCode()
Description copied from class:TypeReturnstrueif this type is allowed to appear in final (clean) Jimple code.- Overrides:
isAllowedInFinalCodein classType- Returns:
-
-